public Character(CharacterInfo.Type _type, String _texture, PhysicsEngine engine, Vector2 _position, Vector2 _size, float bodySize)
     : base(_texture, _size)
 {
     info = Constants.Instance.getCharacterInfo(_type);
     initCharacter ();
     //body.setPosition(_position);
     body = new Body(bodySize, _position); // TODO: size as a FLOAT instead?!
     engine.AddBody(body);
 }
        public void init()
        {
            XElement weaponDoc = XElement.Load(weaponFile);
            IEnumerable<XElement> weapons = weaponDoc.Elements();
            foreach (XElement e in weapons) {
                WeaponInfo w = new WeaponInfo(e);
                weaponsInfo.Add(w.type, w);
            }

            XElement charDoc = XElement.Load(charFile);
            IEnumerable<XElement> characters = charDoc.Elements();
            foreach (XElement e in characters) {
                CharacterInfo c = new CharacterInfo(e);
                charsInfo.Add(c.type, c);
            }
        }
 public CharacterInfo getCharacterInfo(CharacterInfo.Type t)
 {
     return charsInfo[t];
 }