public void Switch(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table) { var leverOn = new LeverSwitchOn(table, Position); atlas.ReplaceWith(new GameActorPosition(this, (Vector2)Position, LayerType.ObstacleInteractable), leverOn); if (Switchable == null) return; leverOn.Switchable = Switchable.Switch(null, atlas, table); }
public void Switch(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table) { var leverOn = new LeverSwitchOn(table, Position); atlas.ReplaceWith(new GameActorPosition(this, (Vector2)Position, LayerType.ObstacleInteractable), leverOn); if (Switchable == null) { return; } leverOn.Switchable = Switchable.Switch(null, atlas, table); }