public LocalObject(LocalShape localShape, string _uniqueName = "", Inventory _inventory = null) { uniqueName = _uniqueName; shape = new ShapeComponent(localShape, this); if (localShape.type == LocalType.Get("Destructible") || localShape.type == LocalType.Get("Container")) { hp = new HPComponent(this); } else if (localShape.type == LocalType.Get("Creature")) { hp = new HPComponent(this); movement = new Movement(this); defence = new Defence(this); attack = new Attack(this); abilities = new Abilities(this); fatigue = new Fatigue(this); eating = new Eating(this); } if (_inventory != null) { inventory = new Inventory(6, 1, "", false, null, this); _inventory.CopyTo(inventory); } }