/// <summary> /// Create a Character with the specified health, ammo, and weapon objects, plus the given name /// </summary> /// <param name="health">CharacterStatusElement for health</param> /// <param name="ammo">CharacterStatusElement for ammo</param> /// <param name="weapon">CharacterStatusElement for the current weapon</param> /// <param name="name">The character's name</param> /// <param name="collisionDetector">Collision detector with which this object should register.</param> public CharacterAbstract(CharacterHealth health, CharacterAmmo ammo, CharacterWeapon weapon, string name, CollisionDetectorInterface collisionDetector) : base() { health_ = health; ammo_ = ammo; weapon_ = weapon; name_ = name; collisionDetector_ = collisionDetector; if (collisionDetector_ != null) { collisionDetector_.register(this); } height_ = new Height(true, true); Inventory_ = new Inventory(); }
public void setAmmo(CharacterAmmo ammo) { ammo_ = ammo; }
/// <summary> /// Create a PlayableCharacter with the specified health, ammo, and weapon objects, plus the given name. /// Also, specify the AnimationSet, frameLengthModifier, velocity, position, direction, /// and depth of the character. /// </summary> /// <param name="pipeline">Drawing pipeline in which to register the object</param> /// <param name="health">CharacterStatusElement for health</param> /// <param name="ammo">CharacterStatusElement for ammo</param> /// <param name="weapon">CharacterStatusElement for the current weapon</param> /// <param name="name">The character's name</param> /// <param name="detector">Collision detector with which the object should register.</param> /// <param name="animations">AnimationSet containing all animations for this object</param> /// <param name="frameLengthModifier">Float representing the ratio of frames in an animation to movement along the screen</param> /// <param name="velocity">Vector of velocity, representing both direction of movement and magnitude</param> /// <param name="position">Position of object relative to the top left corner</param> /// <param name="direction">Vector representing the direction of the object</param> /// <param name="depth">Depth the object is to be drawn to</param> public PlayableCharacterAbstract(List<DrawableObjectAbstract> pipeline, CharacterHealth health, CharacterAmmo ammo, CharacterWeapon weapon, string name, CollisionDetectorInterface detector, AnimationSet animations, float frameLengthModifier, Vector2 velocity, Vector2 position, Vector2 direction, float depth) : base(pipeline, health, ammo, weapon, name, detector, animations, frameLengthModifier, velocity, position, direction, depth) { }
/// <summary> /// Create a Character with the specified health, ammo, and weapon objects, plus the given name. /// Also, specify the AnimationSet, frameLengthModifier, velocity, position, direction, /// and depth of the character. /// </summary> /// <param name="pipeline">List of objects from which the object should be drawn.</param> /// <param name="health">CharacterStatusElement for health</param> /// <param name="ammo">CharacterStatusElement for ammo</param> /// <param name="weapon">CharacterStatusElement for the current weapon</param> /// <param name="name">The character's name</param> /// <param name="collisionDetector">Collision detector with which this object should register.</param> /// <param name="animations">AnimationSet containing all animations for this object</param> /// <param name="frameLengthModifier">Float representing the ratio of frames in an animation to movement along the screen</param> /// <param name="velocity">Vector of velocity, representing both direction of movement and magnitude</param> /// <param name="position">Position of object relative to the top left corner</param> /// <param name="direction">Vector representing the direction of the object</param> /// <param name="depth">Depth the object is to be drawn to</param> public CharacterAbstract(List<DrawableObjectAbstract> pipeline, CharacterHealth health, CharacterAmmo ammo, CharacterWeapon weapon, string name, CollisionDetectorInterface collisionDetector, AnimationSet animations, float frameLengthModifier, Vector2 velocity, Vector2 position, Vector2 direction, float depth) : base(pipeline, animations, frameLengthModifier, velocity, position, direction, depth) { health_ = health; ammo_ = ammo; weapon_ = weapon; name_ = name; collisionDetector_ = collisionDetector; if (collisionDetector_ != null) { collisionDetector_.register(this); } height_ = new Height(true, true); Inventory_ = new Inventory(); }
/// <summary> /// Create a PlayableCharacter with the specified health, ammo, and weapon objects, plus the given name /// </summary> /// <param name="health">CharacterStatusElement for health</param> /// <param name="ammo">CharacterStatusElement for ammo</param> /// <param name="weapon">CharacterStatusElement for the current weapon</param> /// <param name="name">The character's name</param> /// <param name="detector">Collision detector with which this object will register.</param> public PlayableCharacterAbstract(CharacterHealth health, CharacterAmmo ammo, CharacterWeapon weapon, string name, CollisionDetectorInterface detector) : base(health, ammo, weapon, name, detector) { }