public void AddActor(GameRolePlayActorInformations actor) { if (actor is GameRolePlayCharacterInformations character) { Players.Add(character); Console.WriteLine($@"(Player) {character.Name} en cellid -> {character.Disposition.CellId}"); return; } if (actor is GameRolePlayGroupMonsterInformations monster) { Monsters.Add(monster); var monsterName = FastD2IReader.Instance.GetText(ObjectDataManager.Instance .Get <Monster>(monster.StaticInfos.MainCreatureLightInfos.CreatureGenericId).NameId); Console.WriteLine($@"(Monster) {monsterName} en cellid -> {monster.Disposition.CellId}"); return; } if (actor is GameRolePlayNpcInformations npc) { Npcs.Add(npc); var npcName = FastD2IReader.Instance.GetText(ObjectDataManager.Instance.Get <Npc>(npc.NpcId).NameId); Console.WriteLine($@"(Npc) {npcName} en cellid -> {npc.Disposition.CellId}"); return; } Others.Add(actor); Console.WriteLine($@"(Other) Aucune Idée en cellid -> {actor.Disposition.CellId}"); }
private void Init() { Settings.Add(new Setting() { Name = "Edit Lists", Icon = "pencil.png" }); Settings.Add(new Setting() { Name = "Edit Notebooks", Icon = "pencil.png" }); Settings.Add(new Setting() { Name = "Change Notebook", Icon = "folder.png" }); Settings.Add(new Setting() { Name = "Change Account", Icon = "account.png" }); Others.Add(new Setting() { Name = "Settings", Icon = "setting.png" }); Others.Add(new Setting() { Name = "Contact Developer", Icon = "mail.png" }); Others.Add(new Setting() { Name = "Rate and Share", Icon = "rate.png" }); }
public void AddField(Field field) { // field.AddNeighborFunc(id => fieldsById[id]); fields.Add(field); fieldsByPosition.Add(field.Position, field); fieldsById.Add(field.FieldId, field); if (field is Floor) { var floor = (Floor)field; if (floor.HasPlayer()) { if (floor.Player.Id == myId) { Me = floor.Player; } else { Others.Add(floor.Player); } } if (floor.HasBomb()) { bombs.Add(floor.Bomb); bombs = bombs.OrderBy(b => b.RoundsLeft).ToList(); } } }
private void FillOtherCollections(ITenantDBsDir dir) { Others.Clear(); var othrColxns = dir.Collections.For(Date).OtherColxns .GetAll().GroupBy(_ => _.GetGLId()); foreach (var othr in othrColxns) { Others.Add(othr.Key, othr.Sum(_ => _.Amount)); } }
private void PrintHeader(Components c, GroupHeader header) { RowSpec row = new RowSpec(); string note = ""; row.Name = header.TypeDescription + " " + header.Manufacturer; if (header.NoteNumber > 0 || header.NoteNumber1 > 0) { note = "Примеч. " + (header.NoteNumber > 0 ? header.NoteNumber.ToString() : "") + (header.NoteNumber1 > 0 ? ", " + header.NoteNumber1.ToString() : ""); row.Note = note; } Others.Add(row); }
public async Task <ApplicationProductList> GetAllProductsAsync() { var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/all"); ApplicationProductList result = await _requestProvider.GetAsync <ApplicationProductList>(uri); _applicationProductList = result; if (Beverages != null) { Beverages.Clear(); CannedGoods.Clear(); Cleaners.Clear(); DryGoods.Clear(); PaperGoods.Clear(); PersonalCare.Clear(); Others.Clear(); } // populate product types foreach (var i in result.Items) { if (i.Type == null) { i.Type = "others"; } switch (i.Type.ToLower()) { case "beverage": Beverages.Add(new ProductModel(i)); break; case "canned goods": CannedGoods.Add(new ProductModel(i)); break; case "cleaners": Cleaners.Add(new ProductModel(i)); break; case "dry goods": DryGoods.Add(new ProductModel(i)); break; case "paper goods": PaperGoods.Add(new ProductModel(i)); break; case "personal care": PersonalCare.Add(new ProductModel(i)); break; default: Others.Add(new ProductModel(i)); break; } } Beverages = SortCategory(_beverages); CannedGoods = SortCategory(_cannedGoods); Cleaners = SortCategory(_cleaners); DryGoods = SortCategory(_dryGoods); PaperGoods = SortCategory(_paperGoods); PersonalCare = SortCategory(_personalCare); Others = SortCategory(_others); return(result); }