예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 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);
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
        private List <GameActorPosition> GetInteractableTilesInFrontOf(IAtlas atlas)
        {
            List <GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(this, LayerType.Interactables).ToList();

            return(actorsInFrontOf);
        }
예제 #6
0
 private List<GameActorPosition> GetInteractableTilesInFrontOf(IAtlas atlas)
 {
     List<GameActorPosition> actorsInFrontOf = atlas.ActorsInFrontOf(this, LayerType.Interactables).ToList();
     return actorsInFrontOf;
 }
예제 #7
0
 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;
 }