コード例 #1
0
ファイル: Fireplace.cs プロジェクト: codeaudit/BrainSimulator
        private void Ignite(IAtlas atlas, ITilesetTable tilesetTable)
        {
            var fireplaceBurning = new FireplaceBurning(tilesetTable, Position);

            atlas.ReplaceWith(ThisGameActorPosition(LayerType.OnGroundInteractable), fireplaceBurning);
            atlas.RegisterToAutoupdate(fireplaceBurning);
        }
コード例 #2
0
 public void ObjectDetected(IGameObject gameObject, IAtlas atlas)
 {
     if (SomeoneOnTile)
     {
         return;
     }
     NextUpdateAfter = 60;
     atlas.RegisterToAutoupdate(this);
 }
コード例 #3
0
ファイル: StepSwitch.cs プロジェクト: xeronith/BrainSimulator
 public void ObjectDetected(IGameObject gameObject, IAtlas atlas)
 {
     if (m_wasActive)
     {
         m_isActive = true;
         return;
     }
     m_isActive      = true;
     NextUpdateAfter = 1;
     atlas.RegisterToAutoupdate(this);
 }
コード例 #4
0
ファイル: Trap.cs プロジェクト: GoodAI/BrainSimulator
        public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable)
        {
            var avatar = gameObject as IAvatar;
            if (avatar != null)
            {
                avatar.Energy -= ENERGY_FOR_STEP_ON_TRAP;
            }

            var forwardMovable = gameObject as IForwardMovable;
            if (forwardMovable != null)
            {
                forwardMovable.ForwardSpeed = 0;
            }

            gameObject.Position = Vector2.Floor(gameObject.Position) + Vector2.One/2;

            var trapDischarged = new TrapDischarged(tilesetTable, Position);
            atlas.RegisterToAutoupdate(trapDischarged);
            atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable),
                trapDischarged);
        }
コード例 #5
0
        public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable)
        {
            var avatar = gameObject as IAvatar;

            if (avatar != null)
            {
                avatar.Energy -= ENERGY_FOR_STEP_ON_TRAP;
            }

            var forwardMovable = gameObject as IForwardMovable;

            if (forwardMovable != null)
            {
                forwardMovable.ForwardSpeed = 0;
            }

            gameObject.Position = Vector2.Floor(gameObject.Position) + Vector2.One / 2;

            var trapDischarged = new TrapDischarged(tilesetTable, Position);

            atlas.RegisterToAutoupdate(trapDischarged);
            atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable),
                              trapDischarged);
        }
コード例 #6
0
 public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable)
 {
     if(SomeoneOnTile) return;
     NextUpdateAfter = 60;
     atlas.RegisterToAutoupdate(this);
 }
コード例 #7
0
ファイル: Fireplace.cs プロジェクト: GoodAI/BrainSimulator
 private void Ignite(IAtlas atlas, ITilesetTable tilesetTable)
 {
     var fireplaceBurning = new FireplaceBurning(tilesetTable, Position);
     atlas.ReplaceWith(ThisGameActorPosition(LayerType.OnGroundInteractable), fireplaceBurning);
     atlas.RegisterToAutoupdate(fireplaceBurning);
 }