Weapon wep = WeaponBuilder.name("Weapon1").enchantment(Enchantment.FIRE).build();
I'm quite unsure what this example is about. With an entity/component system like I've posted, building the weapons is trivial. It would be just a constructor, and maybe some setter-calls:
class Weapon
{
public:
Weapon(const std::wstring& stName, float damage);
void AddElement(unsigned int id);
};
// usage:
const std::wstring stName = // from xml
const float damage = // from xml
const vector<unsigned int> vElements = // from xml
Weapon wep = entity.AttachComponent<Weapon>(stName, damage, elements); // only if you are using entity/component, otherwise normal constructor
for(auto element : vElements)
{
wep.AddElement(element);
}
// from xml-file
<Entity>
<Weapon name="Weapon1" damage="100">
<Element>1>/Element>
<Weapon/>
</Entity>
Note that really you would want to seperate the weapon definition and refer from the entity only by the name of it. But what would you need a WeaponBuilder-class for such a trivial task as constructing an object?
I love the example Julien (not being sarcastic) ... but just so you know, Scalation is not related to the "scale" of an object. In english it is: Position, Rotation and Scale, not scalation. Scalation is a visual things about the scale patterns on reptiles - similar to Coloration.
Thanks, and thanks for the pointer with the scalation thing... damn, thats one thing I really didn't know, one more mistake I'm not going to make anymore in english ;)