예제 #1
0
 public ISwitchableGameActor Switch(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table)
 {
     RcDoorClosed closedDoor = new RcDoorClosed(table, Position);
     bool added = atlas.Add(new GameActorPosition(closedDoor, (Vector2)Position, LayerType.ObstacleInteractable), true);
     if (!added) return this;
     atlas.Remove(new GameActorPosition(this, (Vector2)Position, LayerType.OnGroundInteractable));
     return closedDoor;
 }
예제 #2
0
 public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable)
 {
     var doorOpened = new SimpleDoorOpened(tilesetTable);
     bool added = atlas.Add(new GameActorPosition(doorOpened, position, LayerType.OnGroundInteractable));
     if (added)
     {
         atlas.Remove(new GameActorPosition(this, position, LayerType.ObstacleInteractable));
     }
 }
예제 #3
0
        public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable)
        {
            var  doorOpened = new SimpleDoorOpened(tilesetTable);
            bool added      = atlas.Add(new GameActorPosition(doorOpened, position, LayerType.OnGroundInteractable));

            if (added)
            {
                atlas.Remove(new GameActorPosition(this, position, LayerType.ObstacleInteractable));
            }
        }
예제 #4
0
        public override void Resolve(GameActorPosition target, IAtlas atlas, ITilesetTable table)
        {
            ICanPickGameObject picker = Sender as ICanPickGameObject;
            IPickableGameActor pickItem = target.Actor as IPickableGameActor;

            if (picker == null || pickItem == null) return;

            if (picker.AddToInventory(pickItem))
                atlas.Remove(target);
        }
예제 #5
0
        public ISwitchableGameActor Switch(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table)
        {
            RcDoorClosed closedDoor = new RcDoorClosed(table, Position);
            bool         added      = atlas.Add(new GameActorPosition(closedDoor, (Vector2)Position, LayerType.ObstacleInteractable), true);

            if (!added)
            {
                return(this);
            }
            atlas.Remove(new GameActorPosition(this, (Vector2)Position, LayerType.OnGroundInteractable));
            return(closedDoor);
        }
예제 #6
0
        public override void Resolve(GameActorPosition target, IAtlas atlas, ITilesetTable table)
        {
            if (target.Actor is Apple || target.Actor is Pear)
            {
                atlas.Remove(target);
            }

            var switcher = target.Actor as ISwitcherGameActor;

            if (switcher != null)
            {
                switcher.Switch(target, atlas, table);
            }
        }
예제 #7
0
        public override void Resolve(GameActorPosition target, IAtlas atlas)
        {
            ICanPickGameObject picker   = Sender as ICanPickGameObject;
            IPickableGameActor pickItem = target.Actor as IPickableGameActor;

            if (picker == null || pickItem == null)
            {
                return;
            }

            if (picker.AddToInventory(pickItem))
            {
                atlas.Remove(target);
            }
        }
예제 #8
0
 public void Update(IAtlas atlas, ITilesetTable table)
 {
     atlas.Remove(new GameActorPosition(this, (Vector2)Position, LayerType.ObstacleInteractable));
 }
예제 #9
0
 public void Burn(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table)
 {
     atlas.Remove(gameActorPosition);
 }
예제 #10
0
 public void DestroyTile(string layer, int x, int y)
 {
     m_atlas.Remove(new GameActorPosition(null, new Vector2(x, y), Layer(layer)));
 }
예제 #11
0
 public void Update(IAtlas atlas)
 {
     atlas.Remove(new GameActorPosition(this, (Vector2)Position, LayerType.ObstacleInteractable));
 }
예제 #12
0
 public void Burn(GameActorPosition gameActorPosition, IAtlas atlas)
 {
     atlas.Remove(gameActorPosition);
 }
예제 #13
0
 public void Burn(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table)
 {
     atlas.Remove(gameActorPosition);
 }