Exemplo n.º 1
0
        public static UnitState CreateState(UnitStateType type, BattleUnit bu)
        {
            UnitState ret = null;

            switch (type)
            {
            case UnitStateType.Idle:
                ret = new UnitStateIdle(bu);
                break;

            case UnitStateType.Attack:
                ret = new UnitStateAttack(bu);
                break;

            case UnitStateType.Rest:
                ret = new UnitStateRest(bu);
                break;

            case UnitStateType.Empowering:
                ret = new UnitStateEmpower(bu);
                break;
            }

            return(ret);
        }
Exemplo n.º 2
0
 public void EmpowerOK()
 {
     if (CurState.Type == UnitStateType.Empowering)
     {
         UnitStateEmpower ue = CurState as UnitStateEmpower;
         ue.EmpowerDone = true;
         if (IsPlayerSide)
         {
             ue.End();
         }
     }
 }