コード例 #1
0
ファイル: Game.cs プロジェクト: spaceorc/aicup2019-paperio
 private HashSet <V> GetBusyPoints()
 {
     return(new HashSet <V>(
                Players.Select(x => x.Pos)
                .Concat(Bonuses.Select(x => x.Pos))
                .Concat(Players.SelectMany(x => x.Lines))));
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: spaceorc/aicup2019-paperio
 private Direction?SendTick(Player player)
 {
     return(player.Client.SendRequestInput(
                new RequestInput
     {
         tick_num = Tick,
         players = Players.ToDictionary(
             x => x == player ? "i" : x.Id.ToString(),
             x => new RequestInput.PlayerData
         {
             position = x.Pos,
             lines = x.Lines.ToArray(),
             territory = x.Territory.Points.ToArray(),
             direction = x.Dir,
             score = x.Score,
             bonuses = x.Bonuses.Select(
                 b => new RequestInput.BonusState
             {
                 type = b.Type,
                 ticks = b.RemainingTicks
             })
                       .ToArray()
         }),
         bonuses = Bonuses.Select(
             x => new RequestInput.BonusData
         {
             position = x.Pos,
             type = x.Type
         })
                   .ToArray()
     })
            .Command);
 }
コード例 #3
0
ファイル: XmlModels.cs プロジェクト: Devwarlt/RedisServer
        public XElement ToXml()
        {
            return
                (new XElement("Fame",
                              GetCharElem(),
                              new XElement("BaseFame", Character.CurrentFame),
                              new XElement("TotalFame", TotalFame),

                              new XElement("Shots", Stats.Shots),
                              new XElement("ShotsThatDamage", Stats.ShotsThatDamage),
                              new XElement("SpecialAbilityUses", Stats.SpecialAbilityUses),
                              new XElement("TilesUncovered", Stats.TilesUncovered),
                              new XElement("Teleports", Stats.Teleports),
                              new XElement("PotionsDrunk", Stats.PotionsDrunk),
                              new XElement("MonsterKills", Stats.MonsterKills),
                              new XElement("MonsterAssists", Stats.MonsterAssists),
                              new XElement("GodKills", Stats.GodKills),
                              new XElement("GodAssists", Stats.GodAssists),
                              new XElement("CubeKills", Stats.CubeKills),
                              new XElement("OryxKills", Stats.OryxKills),
                              new XElement("QuestsCompleted", Stats.QuestsCompleted),
                              new XElement("PirateCavesCompleted", Stats.PirateCavesCompleted),
                              new XElement("UndeadLairsCompleted", Stats.UndeadLairsCompleted),
                              new XElement("AbyssOfDemonsCompleted", Stats.AbyssOfDemonsCompleted),
                              new XElement("SnakePitsCompleted", Stats.SnakePitsCompleted),
                              new XElement("SpiderDensCompleted", Stats.SpiderDensCompleted),
                              new XElement("SpriteWorldsCompleted", Stats.SpriteWorldsCompleted),
                              new XElement("LevelUpAssists", Stats.LevelUpAssists),
                              new XElement("MinutesActive", Stats.MinutesActive),
                              new XElement("TombsCompleted", Stats.TombsCompleted),
                              new XElement("TrenchesCompleted", Stats.TrenchesCompleted),
                              new XElement("JunglesCompleted", Stats.JunglesCompleted),
                              new XElement("ManorsCompleted", Stats.ManorsCompleted),
                              Bonuses.Select(x =>
                                             new XElement("Bonus",
                                                          new XAttribute("id", x.Item1),
                                                          new XAttribute("desc", x.Item2),
                                                          x.Item3
                                                          )
                                             ),
                              new XElement("CreatedOn", DeathTime.ToUnixTimestamp()),
                              new XElement("KilledBy", Killer)
                              ));
        }