public ViewModel() { String[] names = { "VAAN", "ASHE", "FRAN", "BALTHIER", "BASCH", "PENELO" }; for (uint i = 0; i < names.Length; i++) { Party.Add(new Charactor(0x2210 + i * 456, names[i])); } for (uint i = 0; i < 64; i++) { Consumable.Add(new Item(0xDACC + i * 2, 0x6948, 0)); } for (uint i = 0; i < 200; i++) { Weapon.Add(new Item(0xDB4C + i * 2, 0x69CA, 0x1001)); } for (uint i = 0; i < 140; i++) { Armor.Add(new Item(0xDCDC + i * 2, 0x6B58, 0x10C8)); } for (uint i = 0; i < 120; i++) { Accessorie.Add(new Item(0xDDF4 + i * 2, 0x6C70, 0x1154)); } for (uint i = 0; i < 24; i++) { Technique.Add(new Technique(i)); } for (uint i = 0; i < 81; i++) { Magic.Add(new Magic(i)); } }
private void CommandInterpreter(string command, string[] commandArgs) { switch (command) { case "Create": Weapon weapon = weaponFactory.CreateWeapon(commandArgs.Skip(1).ToArray()); weapons.Add(weapon); break; case "Add": Weapon weaponAdd = weapons.FirstOrDefault(w => w.Name == commandArgs[1]); Gem gem = gemFactory.CreateGem(commandArgs.Skip(3).ToArray()); weaponAdd.Add(int.Parse(commandArgs[2]), gem); break; case "Remove": Weapon weaponRemove = weapons.FirstOrDefault(w => w.Name == commandArgs[1]); weaponRemove.Remove(int.Parse(commandArgs[2])); break; case "Print": Weapon weaponPrint = weapons.FirstOrDefault(w => w.Name == commandArgs[1]); Console.WriteLine(weaponPrint); break; } }
public BasedAirUnitData(string jsonString) { // JSONをパース var obj = DynamicJson.Parse(jsonString); // パース結果を翻訳する foreach (var weaponList in obj) { SallyCount.Add((int)weaponList.count); var list = new List <WeaponData>(); foreach (var weapon in weaponList.weapon) { WeaponData weaponData = DataStore.WeaponDataById((int)weapon.id); weaponData.Mas = (int)weapon.mas; weaponData.Rf = (int)weapon.rf; list.Add(weaponData); } Weapon.Add(list); } }
private void handleInventory(GameObject obj) { pickupSound.Play(); Inventory inventory = obj.GetComponent <Inventory>(); switch (inventory.type) { case Inventory.Type.GUN: gun.Add(inventory.count); break; case Inventory.Type.BOMB: bomb.Add(inventory.count); break; case Inventory.Type.KEY: isKeyAvailable = true; Hub.Publish(EventConstants.GOLD_KEY_PICKED); break; } Destroy(obj); }