protected void Toggle(Tile targetTile, bool invertEffect = false) { if (targetTile.ContentActivated ^ invertEffect) targetTile.DeactivateTileContent(); else targetTile.ActivateTileContent(); }
protected virtual void PerformMessage(Tile targetTile, ActionStateX action, bool activated) { targetTile.ExecuteContentActivator(new LogicTileActivator(action)); switch (action.Action) { case ActionState.Clear: if (activated) { targetTile.DeactivateTileContent(); } break; case ActionState.Set: if (activated) { targetTile.ActivateTileContent(); } break; case ActionState.Toggle: if (activated) { Toggle(targetTile); } break; case ActionState.Hold: Toggle(targetTile); break; default: throw new ArgumentOutOfRangeException(); } }
protected void Toggle(Tile targetTile, bool invertEffect = false) { if (targetTile.ContentActivated ^ invertEffect) { targetTile.DeactivateTileContent(); } else { targetTile.ActivateTileContent(); } }
protected virtual void PerformMessage(Tile targetTile, ActionStateX action, bool activated) { targetTile.ExecuteContentActivator(new LogicTileActivator(action)); switch (action.Action) { case ActionState.Clear: if (activated) targetTile.DeactivateTileContent(); break; case ActionState.Set: if (activated) targetTile.ActivateTileContent(); break; case ActionState.Toggle: if (activated) Toggle(targetTile); break; case ActionState.Hold: Toggle(targetTile); break; default: throw new ArgumentOutOfRangeException(); } }