Пример #1
0
 /// <summary>
 /// Generate Troup ranking with join resources, combine them.
 /// </summary>
 /// <returns></returns>
 public object CreateTroupList( ) =>
 from v in _resourceVillage.GetVillageList( ).Where(x => x.Owner.Equals(_resourcePlayer.GetPlayerByName(_profile.Local.Name).Id))
 join g in _groupHandler.GetGroupList( ) on v.Id equals g.Village.Id into groups
 from groupData in groups.DefaultIfEmpty(new GroupData
 {
     Village = v
 })
 join t in _resourceTroup.GetTroupDataList() on v.Id equals t.VillageId into troups
 from troupData in troups.DefaultIfEmpty(new TroupDataVillage {
 })
 select new
 {
     groupData.Groups,
     v.Name,
     v.CoordString,
     v.Points,
     troupData.TroupOwn,
     troupData.TroupVillage,
     troupData.TroupOut,
     troupData.TroupAway,
     UnitPop     = _resourceTroup.GetTroupPop(troupData.TroupOwn),
     UnitPopText = $"{_resourceTroup.GetTroupPop( troupData.TroupOwn )}/24000"
 };