Exemplo n.º 1
0
 private void AddActors(IEnumerable <GameRolePlayActorInformations> actors)
 {
     foreach (var actor in actors)
     {
         if (actor is GameRolePlayGroupMonsterInformations monster)
         {
             Monsters.Add(new MonsterGroup(monster.StaticInfos,
                                           monster.ContextualId, monster.Disposition.CellId));
             continue;
         }
         if (actor is GameRolePlayNpcInformations npc)
         {
             Npcs.Add(new Npc(npc.Disposition.CellId, npc.ContextualId, npc.NpcId));
             continue;
         }
         if (actor is GameRolePlayCharacterInformations player)
         {
             Players.Add(new Player(actor.Disposition.CellId, player.ContextualId, player.Name));
             continue;
         }
         if (actor is GameRolePlayMerchantInformations merchant)
         {
             Merchants.Add(new Merchant(merchant.Disposition.CellId, merchant.ContextualId, merchant.SellType,
                                        merchant.Name));
             continue;
         }
         Entities.Add(new Entity.Entity(actor.ContextualId, actor.Disposition.CellId));
     }
 }
Exemplo n.º 2
0
        public async Task OnGet(string returnUrl = null)
        {
            Merchants = await _db.Merchant.Select(x => new SelectListItem {
                Value = x.Id.ToString(), Text = x.Name
            }).ToListAsync();

            Merchants.Add(new SelectListItem {
                Value = "0", Text = "Non Merchant", Selected = true
            });
            ReturnUrl = returnUrl;
        }
Exemplo n.º 3
0
        void NewGame()
        {
            var assets = Resolve <IAssetManager>();

            PartyMembers.Clear();
            foreach (PartyCharacterId charId in Enum.GetValues(typeof(PartyCharacterId)))
            {
                PartyMembers.Add(charId, assets.LoadCharacter(AssetType.PartyMember, charId));
            }

            Npcs.Clear();
            foreach (NpcCharacterId charId in Enum.GetValues(typeof(NpcCharacterId)))
            {
                Npcs.Add(charId, assets.LoadCharacter(AssetType.Npc, charId));
            }

            Chests.Clear();
            foreach (ChestId id in Enum.GetValues(typeof(ChestId)))
            {
                Chests.Add(id, assets.LoadChest(id));
            }

            Merchants.Clear();
            foreach (MerchantId id in Enum.GetValues(typeof(MerchantId)))
            {
                Merchants.Add(id, assets.LoadMerchant(id));
            }

            _party.Clear();

            Raise(new AddPartyMemberEvent(PartyCharacterId.Tom));
            Raise(new AddPartyMemberEvent(PartyCharacterId.Rainer));
            Raise(new AddPartyMemberEvent(PartyCharacterId.Drirr));
            Raise(new AddPartyMemberEvent(PartyCharacterId.Sira));
            Raise(new AddPartyMemberEvent(PartyCharacterId.Mellthas));
            Raise(new AddPartyMemberEvent(PartyCharacterId.Khunag));

            SetupTestState();
            Raise(new ReloadAssetsEvent()); // No need to keep character info cached once we've loaded it. New game is also a good point to clear out state.
            Raise(new PartyChangedEvent());
            Raise(new LoadMapEvent(MapDataId.Toronto2DGesamtkarteSpielbeginn));
            Raise(new StartClockEvent());
            Loaded = true;
        }
Exemplo n.º 4
0
        public void SummingUpYear()
        {
            Age++;
            Merchants.Sort((a, b) => b.Gold.CompareTo(a.Gold));

            Console.WriteLine("All merchants and they gold:");
            PrintAllMerchants();

            Console.WriteLine("20% of the most unsuccessful merchants, who will be excluded:");

            Int32 toDelete      = Merchants.Count / 5;
            Int32 eightyPercent = Merchants.Count - toDelete;

            for (int i = Merchants.Count - 1; i >= eightyPercent; i--)
            {
                Console.WriteLine("\tPlace #" + (i + 1) + " " + Merchants[i].Name + " with " + Merchants[i].Gold + " gold");
                Merchants.RemoveAt(i);
            }
            Console.WriteLine();

            Console.WriteLine("New merchants:");
            for (int i = 0; i < toDelete; i++)
            {
                MerchantTypes type = Merchants[i].OwnType;
                switch (type)
                {
                case MerchantTypes.altruist: {
                    Merchants.Add(new Altruist("Altruist_" + Age + "_" + i, this));
                    break;
                }

                case MerchantTypes.quirky: {
                    Merchants.Add(new Quirky("Quirky_" + Age + "_" + i, this));
                    break;
                }

                case MerchantTypes.resentful: {
                    Merchants.Add(new Resentful("Resentful_" + Age + "_" + i, this));
                    break;
                }

                case MerchantTypes.slyboots: {
                    Merchants.Add(new Slyboots("Slyboots_" + Age + "_" + i, this));
                    break;
                }

                case MerchantTypes.swindler: {
                    Merchants.Add(new Swindler("Swindler_" + Age + "_" + i, this));
                    break;
                }

                case MerchantTypes.unpredictable: {
                    Merchants.Add(new Unpredictable("Unpredictable_" + Age + "_" + i, this));
                    break;
                }
                }
                Console.WriteLine("\t" + Merchants.Last().Name);
            }
            Console.WriteLine();

            foreach (var item in Merchants)
            {
                item.NullifyGold();
            }

            Deals = new List <Deal>();

            IsSummedUp = true;
        }
Exemplo n.º 5
0
 public void AddMerchant(Merchant merchant)
 {
     Merchants.Add(merchant);
 }
        public void LoadMerchants()
        {
            Merchants.Add(EfMerchantRepository.CreateMerchant_Amazon());

            Merchants.Add(EfMerchantRepository.CreateMerchant_Apple());
        }