void RemoveStats(ItemSO equip) { if (!(equip is GearItemSO || equip is ToolItemSO)) { return; } gearCache = null; if (equip is GearItemSO) { gearCache = equip as GearItemSO; if (gearCache.equipstats.Length <= 0) { return; } for (int i = 0; i < gearCache.equipstats.Length; i++) { if (gearCache.equipstats[i].isPercentage) { GetPlayerStats.AddToStatValue(gearCache.equipstats[i].statType, -GetPlayerStats.GetStatValue(gearCache.equipstats[i].statType) * gearCache.equipstats[i].amount / 100); continue; } GetPlayerStats.AddToStatValue(gearCache.equipstats[i].statType, -gearCache.equipstats[i].amount); } } }
public GameOverPresenter(GameOverView view, GetPlayerStats getPlayerStats, IObserver <GamePlayEvent> gamePlayEventObserver) { this.view = view; this.getPlayerStats = getPlayerStats; this.gamePlayEventObserver = gamePlayEventObserver; }
public LevelWonPresenter(LevelWonView view, GetPlayerStats getPlayerStats, InitNextLevel initNextLevel) { this.view = view; this.getPlayerStats = getPlayerStats; this.initNextLevel = initNextLevel; }