Ejemplo n.º 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;
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 8
0
 public void Update(IAtlas atlas, ITilesetTable table)
 {
     atlas.Remove(new GameActorPosition(this, (Vector2)Position, LayerType.ObstacleInteractable));
 }
Ejemplo n.º 9
0
 public void Burn(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table)
 {
     atlas.Remove(gameActorPosition);
 }
Ejemplo n.º 10
0
 public void DestroyTile(string layer, int x, int y)
 {
     m_atlas.Remove(new GameActorPosition(null, new Vector2(x, y), Layer(layer)));
 }
Ejemplo n.º 11
0
 public void Update(IAtlas atlas)
 {
     atlas.Remove(new GameActorPosition(this, (Vector2)Position, LayerType.ObstacleInteractable));
 }
Ejemplo n.º 12
0
 public void Burn(GameActorPosition gameActorPosition, IAtlas atlas)
 {
     atlas.Remove(gameActorPosition);
 }
Ejemplo n.º 13
0
 public void Burn(GameActorPosition gameActorPosition, IAtlas atlas, ITilesetTable table)
 {
     atlas.Remove(gameActorPosition);
 }