[ogs-changes] dist/c++/ogs/creatures Humanoid.cpp,1.4,1.5 Humanoid.h,1.3,1.4 Undead.h,1.2,1.3
Status: Alpha
Brought to you by:
elemings
|
From: <ele...@us...> - 2003-04-13 05:25:26
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures
In directory sc8-pr-cvs1:/tmp/cvs-serv8841
Modified Files:
Humanoid.cpp Humanoid.h Undead.h
Log Message:
See C++ ChangeLog (Apr 13) for details.
Index: Humanoid.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Humanoid.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Humanoid.cpp 29 Mar 2003 02:10:34 -0000 1.4
--- Humanoid.cpp 13 Apr 2003 05:25:20 -0000 1.5
***************
*** 21,28 ****
*/
#include "ogs/creatures/Humanoid.h"
- using ogs::core::Creature;
using ogs::core::BodyPart;
using ogs::creatures::Humanoid;
--- 21,30 ----
*/
+ #include "ogs/core/BodyPart.h"
+ #include "ogs/core/Creature.h"
#include "ogs/creatures/Humanoid.h"
using ogs::core::BodyPart;
+ using ogs::core::Creature;
using ogs::creatures::Humanoid;
***************
*** 33,37 ****
* create humanoid bodies.
*/
! Creature::Body Humanoid::createBody (Creature& creature) {
BodyPart::Type bodyParts [] = {
BodyPart::HEAD, BodyPart::LEFT_EYE, BodyPart::RIGHT_EYE,
--- 35,39 ----
* create humanoid bodies.
*/
! Creature::Parts Humanoid::createParts () {
BodyPart::Type bodyParts [] = {
BodyPart::HEAD, BodyPart::LEFT_EYE, BodyPart::RIGHT_EYE,
***************
*** 43,63 ****
};
! Creature::Body body;
! const int n = sizeof (bodyParts) / sizeof (BodyPart::Type);
! for (int i = 0; i < n; ++i) {
! BodyPart* part = new BodyPart (creature, bodyParts [i]);
! body.push_back (part);
! }
!
! return (body);
! }
!
! /**
! * Create a humanoid creature. This constructor makes the body of this
! * creature into a humanoid body.
! */
! Humanoid::Humanoid ():
! Creature (createBody (*this)) {
! // empty constructor body
}
--- 45,50 ----
};
! const size_t n = sizeof (bodyParts) / sizeof (BodyPart::Type);
! return (Parts (& bodyParts [0], & bodyParts [n]));
}
Index: Humanoid.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Humanoid.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Humanoid.h 29 Mar 2003 02:10:34 -0000 1.3
--- Humanoid.h 13 Apr 2003 05:25:20 -0000 1.4
***************
*** 26,30 ****
--- 26,34 ----
# define OGS_CREATURES_HUMANOID_H
+ # include <ogs/core/Abilities.h>
# include <ogs/core/Creature.h>
+ # include <ogs/core/Die.h>
+ # include <ogs/core/Size.h>
+ # include <ogs/core/Skill.h>
# include <ogs/creatures/Namespace.h>
***************
*** 32,44 ****
/**
! * A creature with qualities similar to a human.
*/
class Humanoid: public ogs::core::Creature {
public:
! static Body createBody (Creature& creature);
protected:
! Humanoid ();
};
OGS_END_CREATURES_NAMESPACE
--- 36,76 ----
/**
! * A human-like creature. Although humanoids have the same general
! * shape and traits as human beings, size and appearance can vary
! * widely.
*/
class Humanoid: public ogs::core::Creature {
public:
! /** The hit die normally used for humanoid creatures. */
! static const ogs::core::Die::Sides HIT_DIE = ogs::core::Die::d8;
!
! /** The skill rate normally used for humanoid creatures. */
! static const ogs::core::Skill::Points SKILL_RATE = 1;
!
! static Parts createParts ();
protected:
! Humanoid (ogs::core::Die hitDice,
! ogs::core::Abilities abilities,
! ogs::core::Size::Type size = ogs::core::Size::MEDIUM,
! Parts parts = createParts ());
};
+
+ /**
+ * Create a new humanoid creature. This constructor just forwards the
+ * arguments to the Creature constructor.
+ *
+ * @param hitDice Hit dice of creature.
+ * @param abilities Ability scores of creature.
+ * @param size Size of creature.
+ * @param body Body of creature.
+ */
+ inline
+ Humanoid::Humanoid (ogs::core::Die hitDice,
+ ogs::core::Abilities abilities,
+ ogs::core::Size::Type size, Parts parts):
+ Creature (hitDice, abilities, size, parts) {
+ // empty constructor body
+ }
OGS_END_CREATURES_NAMESPACE
Index: Undead.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Undead.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Undead.h 4 Apr 2003 20:22:44 -0000 1.2
--- Undead.h 13 Apr 2003 05:25:20 -0000 1.3
***************
*** 26,30 ****
--- 26,33 ----
# define OGS_CREATURES_UNDEAD_H
+ # include <ogs/core/Abilities.h>
+ # include <ogs/core/Die.h>
# include <ogs/core/Creature.h>
+ # include <ogs/core/Size.h>
# include <ogs/creatures/Namespace.h>
***************
*** 44,53 ****
class Undead: public ogs::core::Creature {
public:
protected:
!
! private:
!
};
OGS_END_CREATURES_NAMESPACE
--- 47,77 ----
class Undead: public ogs::core::Creature {
public:
+ /** The hit die normally used for undead creatures. */
+ static const ogs::core::Die::Sides HIT_DIE = ogs::core::Die::d12;
protected:
! Undead (ogs::core::Die hitDice,
! ogs::core::Abilities abilities,
! ogs::core::Size::Type size = ogs::core::Size::MEDIUM,
! Parts parts = Parts ());
};
+
+ /**
+ * Create a new undead creature. This constructor just forwards the
+ * arguments to the Creature constructor.
+ *
+ * @param hitDice Hit dice of creature.
+ * @param abilities Ability scores of creature.
+ * @param size Size of creature.
+ * @param body Body of creature.
+ */
+ inline
+ Undead::Undead (ogs::core::Die hitDice,
+ ogs::core::Abilities abilities,
+ ogs::core::Size::Type size,
+ Parts parts):
+ Creature (hitDice, abilities, size, parts) {
+ // empty constructor body
+ }
OGS_END_CREATURES_NAMESPACE
|