Esempio n. 1
0
        public static LevelShop FromMetadata(LevelShopMetadata metadata)
        {
            var shop = new LevelShop();

            foreach(var gun in metadata.Guns)
            {
                shop.Guns.Add(GunShopItem.FromMetadata(gun));
            }

            foreach (var shield in metadata.Shields)
            {
                shop.Shields.Add(ShieldShopItem.FromMetadata(shield));
            }

            foreach (var body in metadata.Bodies)
            {
                shop.Bodies.Add(BodyShopItem.FromMetadata(body));
            }

            shop.ItemsSetToDisplay.AddRange(shop.Guns);

            return shop;
        }
Esempio n. 2
0
 public void Initialize()
 {
     ShopComponent = LevelShop.FromMetadata(_game.Content.Load<LevelShopMetadata>(@"Shop\LevelShop1"));
     ShopComponent.Position = new Vector2(50, 100);
     ShopComponent.Initialize(_game);
 }