using UnityEngine;
public abstract class Objective {
protected Room room;
protected Player player;
protected bool activated;
protected bool finished;
///
/// Constructs a new Objective instance.
///
///
public Objective(Room caller) {
this.room = caller;
}
///
/// Handle activation code for a goal.
///
/// Player
public virtual void ActivateGoal(Player ply) {
if ( activated )
return;
activated = true;
player = ply;
}
///
/// Tracks / Updates the progess of a goal.
///
public abstract void UpdateGoal();
///
/// Code executed if the goal is reached eg. opening doors.
///
protected virtual void ReachedGoal() {
finished = true;
room.Unlock();
Debug.Log("[ROOM] Goal reached. Doors will open.");
}
///
/// Returns wether the goal was reached or not.
///
///
public bool GetFinished() {
return finished;
}
public Player GetPlayer() {
return player;
}
}