private List <GameActorPosition> GetInteractableObjectsInFrontOf(IAtlas atlas) { // check circle in front of avatar float radius = ((CircleShape)PhysicalEntity.Shape).Radius; List <GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(this, LayerType.Object, 0.2f + radius, radius).ToList(); return(actorsInFrontOf); }
public void TestActorsInFrontOf() { IAvatar avatar = m_atlas.GetAvatars()[0]; List <GameActorPosition> results = m_atlas.ActorsInFrontOf(avatar).ToList(); Assert.IsType <Background>(results[0].Actor); Assert.IsType <Apple>(results[1].Actor); }
public void Use(GameActorPosition senderPosition, IAtlas atlas, ITilesetTable tilesetTable) { IEnumerable<GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(senderPosition.Actor as ICharacter).ToList(); if (actorsInFrontOf.Select(x => x.Actor).Contains(Switchable as GameActor)) { GameActorPosition switchable = actorsInFrontOf.First(x => x.Actor == Switchable); Switch(switchable, atlas, tilesetTable); } }
public void Use(GameActorPosition senderPosition, IAtlas atlas) { IEnumerable <GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(senderPosition.Actor as ICharacter).ToList(); if (actorsInFrontOf.Select(x => x.Actor).Contains(Switchable as GameActor)) { GameActorPosition switchable = actorsInFrontOf.First(x => x.Actor == Switchable); Switch(switchable, atlas); } }
private List <GameActorPosition> GetInteractableTilesInFrontOf(IAtlas atlas) { List <GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(this, LayerType.Interactables).ToList(); return(actorsInFrontOf); }
private List<GameActorPosition> GetInteractableTilesInFrontOf(IAtlas atlas) { List<GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(this, LayerType.Interactables).ToList(); return actorsInFrontOf; }
private List<GameActorPosition> GetInteractableObjectsInFrontOf(IAtlas atlas) { // check circle in front of avatar float radius = ((CircleShape)PhysicalEntity.Shape).Radius; List<GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(this, LayerType.Object, 0.2f + radius, radius).ToList(); return actorsInFrontOf; }