public void setState(CharacterState newState, MoveStats move = null) { if (newState == CharacterState.attacking || newState == CharacterState.charging || newState == CharacterState.shielding) { if (newState != CharacterState.shielding && move == null) { throw new NotImplementedException(); } attackMode = true; } else { attackMode = false; } if (newState == CharacterState.jumping || newState == CharacterState.falling) { inAir = true; } if (newState != state) { view.StateChanged(state, newState, move); state = newState; } }
public MoveModel(MoveStats stats, bool right, int playerIndex) { Stats = stats; attackTimeLeft = stats.Duration; chargeTime = 0; Started = false; Ended = false; Xdirection = right ? new Vector2(1, 1) : new Vector2(-1, 1); PlayerIndexes = new List <int>(); PlayerIndexes.Add(playerIndex); }