Source: armour.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
                          armour.h  -  description
                             -------------------
    begin                : Sun Jan 23 2000
    copyright            : (C) 2000 by Daniel Roberge
    email                : droberge@uvic.ca
 ***************************************************************************/

#ifndef _ARMOUR_H
#define _ARMOUR_H
#include "invitem.h"

/**This is a representation of a basic suit of armour
  *@author Daniel Roberge
  */

class Shield;

class Armour : public InventoryItem
{
 private:
  int baseAC,ACMod[4];
  bool shield;
  friend Shield;
  /**Adds a shield (only Shield class should call this)*/
  void equipShield();
  /**Removes a shield (only Shield class should call this)*/
  void removeShield();
 public:
  /**Makes an Armour object that represents no armour*/
  Armour(void);
  Armour(int,int,int,int,int,char *,int);
  /**Makes an Armour object that is identical to that pointed to by model*/
  Armour(Armour *model);
  /**Returns the AC for damage type DamageType*/
  int getAC(int DamageType) const;
  /**Returns the AC unmodified for damage type*/
  int getAC() const;
  virtual InventoryType getType();
/*  static void initLibrary();
  static Armour *None,*Leather,*StLeather,*Brigandine,*ChainMail,*Banded,*PlateMail,*FieldPlate,*FullPlate;
  static Armour * None;
  static Armour * Leather;
  static Armour * StLeather;
  static Armour * Brigandine;
  static Armour * ChainMail;
  static Armour * Banded;
  static Armour * PlateMail;
  static Armour * FieldPlate;
  static Armour * FullPlate;*/
};

typedef Armour &RArmour;
typedef Armour *PArmour;

/**Represents a basic shield. 'Attaches' to an Armour object whose AC it modifies.
  *@author Daniel Roberge
  */


class Shield: public InventoryItem
{
 private:
  Armour *attachedTo;
  bool isAttached;
 public:
  /**Creates an unattached shield*/
  Shield();
  /**Creates a shield attached to Armour at*/
  Shield(PArmour at);
  /**Detaches the shield before deletion*/
  virtual ~Shield();
  /**Attaches the shield to Armour at*/
  void attach(PArmour at);
  /**Detaches the shield from its attached Armour*/
  void detach();
  /**Returns the inventory type*/
  virtual InventoryType getType() { return SH_FLAG; };
};

#ifdef AR_LIB
class ArmourLibrary {
	public:
		static const Armour* None;
		static const Armour* Leather;
		static const Armour* StLeather;
		static const Armour* Brigandine;
		static const Armour* ChainMail;
		static const Armour* Banded;
		static const Armour* PlateMail;
		static const Armour* FieldPlate;
		static const Armour* FullPlate;
		static void initLib();
};

#endif	
#endif

Generated by: droberge@magebook.localdomain on Mon Jul 3 13:20:08 200.