示例#1
0
 public Target(bool isTroopFlag, Vector3 initialPosition, bool flagDoubleTime = false, TroopOnField t = null)
 {
     isTroop = isTroopFlag;
     doubleTime = flagDoubleTime;   //TODO: implement detection of doubletime
     initialPos = initialPosition;
     troop = t;
 }
示例#2
0
    public TroopStateController(TroopOnField troop)
    {
        //Declare all states and put them in List<TroopState>
        Standby s = new Standby();
        March m = new March();

        //Declare all possible transitions
        T_S_M t_s_m = new T_S_M(s, m);
        T_M_S t_m_s = new T_M_S(m, s);

        //Create transition list for each state
        List<Transition> transition_s = new List<Transition>();
        transition_s.Add(t_s_m);
        List<Transition> transition_m = new List<Transition>();
        transition_m.Add(t_m_s);

        //Put relevant transitions in each of the state
        s.initialize(troop, transition_s);
        m.initialize(troop, transition_m);

        //Set up the first state
        activeState = s;
    }
示例#3
0
 public void initialize(TroopOnField t, List<Transition> transitions)
 {
     this.troop = t;
     this.transitions = transitions;
 }