Exemplo n.º 1
0
        private static void createIngredients(GameContext context)
        {
            Item sorbitol = new Item
            {
                Name = "sorbitol",
                Type = Item.TYPE_INGREDIENT
            };

            Item citroenzuur = new Item
            {
                Name = "citroenzuur",
                Type = Item.TYPE_INGREDIENT
            };

            Item kaliumsorbaat = new Item
            {
                Name = "kaliumsorbaat",
                Type = Item.TYPE_INGREDIENT
            };

            Item natriumsaccharinaat = new Item
            {
                Name = "natriumsaccharinaat",
                Type = Item.TYPE_INGREDIENT
            };

            Item dextromethorfanhydrobromide = new Item
            {
                Name = "Dextromethorfanhydrobromide",
                Type = Item.TYPE_INGREDIENT
            };

            ShopItem shopSorbitol = new ShopItem
            {
                Item  = sorbitol,
                Price = 300
            };

            ShopItem shopCitroenzuur = new ShopItem
            {
                Item  = citroenzuur,
                Price = 300
            };

            ShopItem shopKaliumsorbaat = new ShopItem
            {
                Item  = kaliumsorbaat,
                Price = 300
            };

            ShopItem shopNatriumsaccharinaat = new ShopItem
            {
                Item  = natriumsaccharinaat,
                Price = 300
            };

            ShopItem shopDextromethorfanhydrobromide = new ShopItem
            {
                Item  = dextromethorfanhydrobromide,
                Price = 300
            };

            context.Ingredients.Add(sorbitol);
            context.Ingredients.Add(citroenzuur);
            context.Ingredients.Add(kaliumsorbaat);
            context.Ingredients.Add(natriumsaccharinaat);
            context.Ingredients.Add(dextromethorfanhydrobromide);

            context.ShopItems.Add(shopSorbitol);
            context.ShopItems.Add(shopCitroenzuur);
            context.ShopItems.Add(shopKaliumsorbaat);
            context.ShopItems.Add(shopNatriumsaccharinaat);
            context.ShopItems.Add(shopDextromethorfanhydrobromide);
        }
Exemplo n.º 2
0
        public static void Initialize(GameContext context)
        {
            context.Database.EnsureCreated();

            if (!context.Games.Any())
            {
                Team      t1          = new Team("testTeam", 100);
                Inventory inventoryT1 = new Inventory();
                t1.Inventory = inventoryT1;

                Team      t2          = new Team("otherTeam", 100);
                Inventory inventoryT2 = new Inventory();
                t2.Inventory = inventoryT2;

                Team      t3          = new Team("newTeam", 100);
                Inventory inventoryT3 = new Inventory();
                t3.Inventory = inventoryT3;

                Location l1 = new Location(51.229023, 4.404622, "MAS", 300);
                Location l2 = new Location(51.216968, 4.409315, "Rubenshuis", 300);
                Location l3 = new Location(51.222759, 4.397382, "Het Steen", 300);

                Game g1 = new Game();
                g1.Teams.Add(t1);
                g1.Teams.Add(t2);
                g1.Teams.Add(t3);

                l1.Quiz     = initialiseQuizMas(context);
                l1.subs     = initialiseSubMas(context);
                l1.dads     = initialiseDadMas(context);
                l1.anagrams = initialiseAnagramMas(context);

                l2.Quiz     = initialiseQuizRuben(context);
                l2.subs     = initialiseSubRuben(context);
                l2.dads     = initialiseDadRuben(context);
                l2.anagrams = initialiseAnagramRuben(context);

                l3.Quiz     = initialiseQuizSteen(context);
                l3.subs     = initialiseSubSteen(context);
                l3.dads     = initialiseDadSteen(context);
                l3.anagrams = initialiseAnagramSteen(context);



                createShopItems(context);
                createIngredients(context);

                context.Inventories.Add(inventoryT1);
                context.Inventories.Add(inventoryT2);
                context.Inventories.Add(inventoryT3);

                context.Teams.Add(t1);
                context.Teams.Add(t2);
                context.Teams.Add(t3);

                context.Locations.Add(l1);
                context.Locations.Add(l2);
                context.Locations.Add(l3);

                context.Games.Add(g1);
            }

            context.SaveChanges();
        }