private bool IsBadPoint(GameTileState state) { return( state == GameTileState.Obstacle || state == GameTileState.WormBody || state == GameTileState.WormHead); }
public static bool CanChangeState(this GameTileState thisState) { return( thisState == GameTileState.Empty || thisState == GameTileState.Vampire || thisState == GameTileState.Ghost || thisState == GameTileState.Human); }
public void ClearTile() { expectedState = GameTileState.Empty; currentState = GameTileState.Empty; if (OnCurrentStateChange != null) { OnCurrentStateChange.Invoke(currentState); } }
public void Set(BoardPoint p, GameTileState state) { if (tiles[p.X, p.Y].State != state) { tiles[p.X, p.Y].State = state; if (fireUpdateEvents) { OnBoardUpdate(this, new EventArgs()); } } }
public void SetExpectedState(GameTileState expected, GameTileState current = GameTileState.Empty) { expectedState = expected; if (expectedState.CanChangeState()) { currentState = current; } else { currentState = expectedState; } }
public bool ChangeState(GameTileState newState) { bool changed = false; if (currentState.CanChangeState() && currentState != newState) { currentState = newState; changed = true; if (OnCurrentStateChange != null) { OnCurrentStateChange.Invoke(currentState); } } return(changed); }
private Sprite GetSpriteForTile(GameTileState state) { switch (state) { case GameTileState.WormHead: return(wormHeadTile); case GameTileState.WormBody: return(wormBodyTile); case GameTileState.Obstacle: return(obstacleTile); case GameTileState.Empty: default: return(emptyTile); } }
public bool Equals(GameTileState state) { return(power == state.power && row == state.row && column == state.column); }
public GameTile(GameTileState expected, GameTileState current = GameTileState.Empty) { SetExpectedState(expected, current); }
public static bool IsMirror(this GameTileState thisState) { return( thisState == GameTileState.MirrorBotLeftTopRight || thisState == GameTileState.MirrorTopLeftBotRight); }