World.GameActors.Tiles.ObstacleInteractable.LeverSwitchOn.Switch C# (CSharp) Method

Switch() public method

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