示例#1
0
 public void Initialize()
 {
     ShopComponent = LevelShop.FromMetadata(_game.Content.Load<LevelShopMetadata>(@"Shop\LevelShop1"));
     ShopComponent.SelectedTabIndex = SelectedCategory;
     ShopComponent.Position = new Vector2(50, 110);
     ShopComponent.Initialize(_game);
 }
示例#2
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));
            }

            for (int i = 0; i < metadata.Medcits.Count; i++)
            {
                shop.Medcits.Add(MedcitShopItem.FromMetadata(metadata.Medcits[i]));
            }

            for (int i = 0; i < metadata.Tablets.Count; i++)
            {
                shop.Tablets.Add(TabletShopItem.FromMetadata(metadata.Tablets[i]));
            }

            for (int i = 0; i < metadata.Spikes.Count; i++)
            {
                shop.Spikes.Add(SpikeShopItem.FromMetadata(metadata.Spikes[i]));
            }

            for (int i = 0; i < metadata.FrontWeapons.Count; i++)
            {
                shop.FrontWeapons.Add(FrontWeaponShopItem.FromMetadata(metadata.FrontWeapons[i]));
            }

            return shop;
        }