Beispiel #1
0
    public void SetState(Unit.UnitState state)
    {
        unit.currentUnitState = state;

        if (!InPrepState(state))
        {
            onUnitPastPlanning(unit);
        }

        if (state == Unit.UnitState.selected)
        {
            SetSelected();
        }
        else if (state == Unit.UnitState.moving)
        {
            SetMoving(true);
        }
        else if (state == Unit.UnitState.cooldown)
        {
            SetOnCooldown();
        }
        else if (state == Unit.UnitState.attacking)
        {
            SetAttacking();
        }
        else if (state == Unit.UnitState.unselected)
        {
            SetUnselected();
        }
        else if (state == Unit.UnitState.planningMovement)
        {
            SetPlanningMovement();
        }
        else if (state == Unit.UnitState.planningAttack)
        {
            SetPlanningAttack();
        }
    }
Beispiel #2
0
 void StopTimer(Unit.UnitState state)
 {
     hourGlass.enabled = false;
 }
Beispiel #3
0
 public UnitStateChangeEvent(Unit.UnitState state, Unit unit)
 {
     State = state;
     Unit = unit;
 }
Beispiel #4
0
 private static bool InPrepState(Unit.UnitState state)
 {
     return(state == Unit.UnitState.selected ||
            state == Unit.UnitState.planningAttack ||
            state == Unit.UnitState.planningMovement);
 }
Beispiel #5
0
 public List <Unit> GetUnitsInState(Unit.UnitState state)
 {
     return(Units.Where(u => u.State == state).ToList());
 }