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); }
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)); }
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); }