public PartMetal() { MetalType = new MetalType(); MetalFinish = new MetalFinish(); SetDefaults(); // Part = new Part(); }
public MetalAccount(string clientAccount, string clientName, MetalType metal, uint balance, decimal price) : base(clientAccount, clientName) { _type = metal; _metalBalance = balance; _priceRate = price; this.IncreaseBalance((decimal)(_metalBalance * _priceRate)); }
public SalesSupply(MetalType metalType, int metalAmount, DateTime deadline, ContactInfo contact) { MetalType = metalType; MetalAmount = metalAmount; HighestPrice = 0; Deadline = deadline; ContactInfo = contact; HighestBuyingOffer = null; ImgFolderPath = "C:/Users/Louise Helene Hamle/source/repos/Lesson22Assignment/Auction/AuctionLibrary/Img"; if (MetalType == MetalType.Guld) { ImgPath = ImgFolderPath + "/Guld.png"; } else if (MetalType == MetalType.Sølv) { ImgPath = ImgFolderPath + "/Sølv.png"; } else if (MetalType == MetalType.Platin) { ImgPath = ImgFolderPath + "/Platin.png"; } else { ImgPath = ImgFolderPath + "/Palladium.png"; } }
public ArmorMetadata(float armorRating, int durability, MetalType metal, ItemTypesServer.ItemTypeRaw itemType, ArmorSlot slot) { ArmorRating = armorRating; Durability = durability; Metal = metal; ItemType = itemType; Slot = slot; }
public WeaponMetadata(float damage, int durability, MetalType metalType, WeaponType weaponType, ItemTypesServer.ItemTypeRaw item) { Damage = damage; Metal = metalType; WeaponType = weaponType; ItemType = item; Durability = durability; }
public void OpenMetalAccount(MetalType type, uint initAmount, decimal price) { var account = "ACC" + AccountType.Metal.ToString() + (_openedAccountsCount + 1).ToString() + type.ToString() + _number.ToString(); var newAccount = new MetalAccount(account, _name, type, initAmount, price); MetalAccounts.Add(newAccount); _openedAccountsCount++; }
public ActionResult DeleteConfirmed(int id) { MetalType metalType = db.MetalTypes.Find(id); db.MetalTypes.Remove(metalType); db.SaveChanges(); return(RedirectToAction("Index")); }
public Metal(string name, int to_hit, int damage, int ac, double costmod, MetalType type) { Name = name; ToHit = to_hit; Damage = damage; ArmorClass = ac; CostMultiplier = costmod; Type = type; }
public Metal(string name, int toHit, int damage, int ac, double costmod, MetalType type) { Name = name; ToHit = toHit; Damage = damage; ArmorClass = ac; CostMultiplier = costmod; Type = type; }
public ActionResult Edit([Bind(Include = "id,MetTypeName")] MetalType metalType) { if (ModelState.IsValid) { db.Entry(metalType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(metalType)); }
public ActionResult Create([Bind(Include = "id,MetTypeName")] MetalType metalType) { if (ModelState.IsValid) { db.MetalTypes.Add(metalType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(metalType)); }
public void AddMaterial(MetalType mat) { if (mat == MetalType.Copper) { copper.Add(mat); } else if (mat == MetalType.Zinc) { zinc.Add(mat); } }
// GET: MetalTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MetalType metalType = db.MetalTypes.Find(id); if (metalType == null) { return(HttpNotFound()); } return(View(metalType)); }
public void OpenMetalAccount(MetalType type, uint initAmount, decimal price) { try { if (price <= 0) { throw new InvalidOperationException("Курс не может быть отрицательным или нулевым!"); } var account = "ACC" + (int)AccountType.MetalAccount + (_openedAccountsCount + 1).ToString() + (int)type + _number.ToString(); var newAccount = new MetalAccount(account, _name, type, initAmount, price); _accounts.Add(newAccount); _openedAccountsCount++; } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public MetalAccount(string clientAccount, string clientName, MetalType metal, uint weight, decimal price) : base(clientAccount, clientName) { try { _type = metal; _metalBalance = weight; if (price <= 0) { throw new InvalidOperationException("Курс не может быть отрицательным или нулевым!"); } _priceRate = price; this.IncreaseBalance((decimal)(_metalBalance * _priceRate)); } catch (InvalidOperationException) { throw; } catch (Exception) { throw new Exception("Произошла какая-то ошибка!"); } }
/// <summary> /// Metodo responsavel por calcular o numero de credito galactico. /// Data de Criação: 07/05/2017 /// </summary> /// <param name="metalType">Tipo de Metal</param> /// <param name="romanNumber">Numero em Romano</param> /// <returns></returns> private static double CalculateGalacticCredit(MetalType metalType, string romanNumber) { var integer = Roman.ConvertRomanToInteger(romanNumber); switch (metalType) { case MetalType.None: return(integer); case MetalType.Iron: return(195.5 * integer); case MetalType.Gold: return(14450 * integer); case MetalType.Silver: return(17 * integer); default: return(0); } }
/// <summary> /// Adiona um metal ao inventário /// </summary> /// <param name="metalType">Elemento metal</param> /// <param name="amount">Quantidade</param> public void AddMetal(MetalType metalType, int amount) { metal[metalType] += amount; }
public Metal() { _metalType = MetalType.None; }
public Metal(MetalType mt) { _metalType = mt; }