internal void PrintInventory() { if (this.GoldAmount > 0) { Console.WriteLine($"<Gold> ${this.GoldAmount}"); Console.WriteLine($"##Gold - {this.GoldAmount}"); } if (this.GemsAmount > 0) { Console.WriteLine($"<Gem> ${this.GemsAmount}"); var sortedGems = GemTypes .OrderByDescending(x => x.Key); foreach (var gem in sortedGems) { Console.WriteLine($"##{gem.Key} - {gem.Value}"); } } if (this.CashAmount > 0) { Console.WriteLine($"<Cash> ${this.CashAmount}"); var sortedCash = CashTypes .OrderByDescending(x => x.Key); foreach (var type in sortedCash) { Console.WriteLine($"##{type.Key} - {type.Value}"); } } }
public static string gemToString(GemTypes gem) { if (gem == GemTypes.Unknown) { return("???"); } return(gem.ToString()); }
private GemTypes gemFromColor(Color color) { string identifyerString = ""; identifyerString += getNumberFromColorComp(color.R); identifyerString += getNumberFromColorComp(color.G); identifyerString += getNumberFromColorComp(color.B); GemTypes resultGem = GemTypes.Unknown; switch (identifyerString) { case "333": resultGem = GemTypes.White; break; case "311": resultGem = GemTypes.Red; break; case "332": resultGem = GemTypes.Orange; break; case "331": resultGem = GemTypes.Yellow; break; case "232": resultGem = GemTypes.Green; break; case "132": resultGem = GemTypes.Green; break; case "123": resultGem = GemTypes.Blue; break; case "313": resultGem = GemTypes.Pink; break; case "212": resultGem = GemTypes.Pink; break; case "312": resultGem = GemTypes.Pink; break; case "213": resultGem = GemTypes.Pink; break; } return(resultGem); }
public AmethystGem( GemTypes gemType, GemClarities gemClarity) : base( gemType, gemClarity, Strength, Agility, Vitality) { }
public EmeraldGem( GemTypes gemType, GemClarities gemClarity) : base( gemType, gemClarity, Strength, Agility, Vitality) { }
public AddGemToSocketCommand( IDatabase <Weapon> repository, WeaponFactory weaponFactory, GemFactory gemFactory, string weaponName, int socketIndex, GemClarities gemClarity, GemTypes gemType) : base(repository, weaponFactory, gemFactory, weaponName) { this.socketIndex = socketIndex; this.gemClarity = gemClarity; this.gemType = gemType; }
public void AddGems(long gemsAmount, string gemName) { bool hasSpace = this.GoldAmount + this.GemsAmount + this.CashAmount + gemsAmount <= this.Capacity; bool lessThanGold = this.GoldAmount >= this.GemsAmount + gemsAmount; if (!hasSpace || !lessThanGold) { return; } if (!GemTypes.ContainsKey(gemName)) { GemTypes[gemName] = 0; } GemTypes[gemName] += gemsAmount; this.GemsAmount += gemsAmount; }
public Gem CreateGem(GemTypes gemType, GemClarities gemClarity) { Gem gem = null; switch (gemType) { case GemTypes.Amethyst: gem = new AmethystGem(gemType, gemClarity); break; case GemTypes.Emerald: gem = new EmeraldGem(gemType, gemClarity); break; case GemTypes.Ruby: gem = new RubyGem(gemType, gemClarity); break; } return gem; }
public Gem( GemTypes gemType, GemClarities gemClarity, int strengthIncrease, int agilityIncrease, int vitalityIncrease) { this.gemType = gemType; this.gemClarity = gemClarity; this.StrengthIncrease = (int)gemClarity + strengthIncrease; this.AgilityIncrease = (int)gemClarity + agilityIncrease; this.VitalityIncrease = (int)gemClarity + vitalityIncrease; this.MinDamageIncrease = (StrengthMinDamageIncrease * this.StrengthIncrease) + (AgilityhMinDamageIncrease * this.AgilityIncrease); this.MaxDamageIncrease = (StrengthMaxDamageIncrease * this.StrengthIncrease) + (AgilityhMaxDamageIncrease * this.AgilityIncrease); }
public void setGem(int gridX, int gridY, GemTypes gem) { gemArray[gridX, gridY] = gem; }