Beispiel #1
0
        private static GameActorPosition TileAt(ILayer <GameActor> layer, Vector2 position)
        {
            GameActor actor = layer.GetActorAt((int)Math.Floor(position.X), (int)Math.Floor(position.Y));

            if (actor == null)
            {
                return(null);
            }
            GameActorPosition actorPosition = new GameActorPosition(actor, position, layer.LayerType);

            return(actorPosition);
        }
Beispiel #2
0
        public void AvatarCanEat()
        {
            AvatarLoosingEnergy();

            m_eater.Interact = true;

            // Act
            m_eater.Update(m_worldPickupWorld.Atlas, It.IsAny <TilesetTable>());

            // Assert
            Assert.Equal(m_eater.Energy, 1);
            ILayer <GameActor> obstacleInteractableLayer = m_worldPickupWorld.Atlas.GetLayer(LayerType.ObstacleInteractable);

            Assert.Null(obstacleInteractableLayer.GetActorAt(2, 0));
        }
Beispiel #3
0
        public void AvatarCanLayDown()
        {
            AvatarCanPickUp();

            m_avatarPickuper.PickUp = true;

            // Act
            m_avatarPickuper.Update(m_worldPickupWorld.Atlas, It.IsAny <TilesetTable>());

            // Assert
            Assert.Null(m_avatarPickuper.Tool);
            ILayer <GameActor> obstacleInteractableLayer = m_worldPickupWorld.Atlas.GetLayer(LayerType.ObstacleInteractable);

            Assert.IsType <Apple>(obstacleInteractableLayer.GetActorAt(2, 0));
            Assert.False(m_avatarPickuper.PickUp);
        }