private void CloneMembers(RPGStatsComponent original) { health = original.health; mana = original.mana; nourishment = original.nourishment; strength = original.strength; }
void IConsumer.Consume(Item item) { if (item == null) { return; } ConsumableComponent consumable = item.GetComponent <ConsumableComponent>(); RPGStatsComponent stats = GetComponent <RPGStatsComponent>(); if (consumable == null || stats == null) { return; } stats.Consume(consumable); if (consumable.IsSpent) { Inventory.Remove(item); } NotifyRedrawObservers(new RedrawNotification($"{Name} consumed {item.Name}, " + $"receiving effect: [{consumable.Effect.ToString()}] for {consumable.Potency} points")); }
private RPGStatsComponent(RPGStatsComponent original) { CloneMembers(original); }