コード例 #1
0
        protected IEnumerable <Tuple <TilePosition, int, IGrabableItem[]> > GetCreatures(CreatureItem creatureData)
        {
            int creatureCount = creatureData.CreaturesCount + 1;
            var possesions    = GetPossesions(creatureData, creatureCount);

            return(creatureData.GetCreaturesInfo().Zip(possesions, (x, y) => Tuple.Create(x.Item1, x.Item2, y)));
        }
コード例 #2
0
        public IEnumerable<Creature> AddCreature(CreatureItem creature, Tile tile)
        {
            var creatureDescriptor = builder.Data.CreatureDescriptors[(int)creature.Type];
            var duration = creatureDescriptor.MovementDuration * 1000 / 6;
            duration = MathHelper.Clamp(duration, 500, 1200);
            var layout = GetGroupLayout(creature);
            var res = new List<Creature>();

            foreach (var tuple in creature.GetCreaturesInfo().Take(creature.CreaturesCount + 1))
            {
                var space = layout.AllSpaces.First(s => tuple.Item1.ToDirections().All(s.Sides.Contains));
                res.Add(new Creature(layout, new FourthSpaceRouteElement(space, tile), builder.CreatureToken,
                    builder.ChampionToken.ToEnumerable(), duration, creatureDescriptor.DetectionRange, creatureDescriptor.SightRange));
            }

            return res;
        }
コード例 #3
0
        public IEnumerable <Creature> AddCreature(CreatureItem creature, Tile tile)
        {
            var creatureDescriptor = builder.Data.CreatureDescriptors[(int)creature.Type];
            var duration           = creatureDescriptor.MovementDuration * 1000 / 6;

            duration = MathHelper.Clamp(duration, 500, 1200);
            var layout = GetGroupLayout(creature);
            var res    = new List <Creature>();

            foreach (var tuple in creature.GetCreaturesInfo().Take(creature.CreaturesCount + 1))
            {
                var space = layout.AllSpaces.First(s => tuple.Item1.ToDirections().All(s.Sides.Contains));
                res.Add(new Creature(layout, new FourthSpaceRouteElement(space, tile), builder.CreatureToken,
                                     builder.ChampionToken.ToEnumerable(), duration, creatureDescriptor.DetectionRange, creatureDescriptor.SightRange));
            }

            return(res);
        }