[ogs-changes] dist/c++/ogs/creatures/humanoids Human.cpp,NONE,1.1 Human.h,1.1,1.2 Makefile.am,1.1,1.
Status: Alpha
Brought to you by:
elemings
|
From: <ele...@us...> - 2003-03-29 02:11:10
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures/humanoids
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/creatures/humanoids
Modified Files:
Human.h Makefile.am Namespace.h
Added Files:
Human.cpp
Log Message:
See C++ ChangeLog (Mar 28) for details.
--- NEW FILE: Human.cpp ---
/*
* Human.cpp -- class implementation for humans
* Copyright (C) 2003 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA
*
* RCS: $Id: Human.cpp,v 1.1 2003/03/29 02:10:35 elemings Exp $
*/
#include "ogs/core/Die.h"
#include "ogs/creatures/humanoids/Human.h"
using ogs::core::Die;
using ogs::creatures::humanoids::Human;
Die Human::_maximumAge (Die::d20, 2);
Index: Human.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Human.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Human.h 23 Mar 2003 22:14:36 -0000 1.1
--- Human.h 29 Mar 2003 02:10:35 -0000 1.2
***************
*** 23,34 ****
#ifdef __cplusplus
! # ifndef OGS_HUMAN_H
! # define OGS_HUMAN_H
# include <ogs/core/details/Maturity.h>
# include <ogs/creatures/Humanoid.h>
! # include <ogs/creatures/Namespace.h>
! OGS_BEGIN_CREATURES_NAMESPACE
/**
--- 23,35 ----
#ifdef __cplusplus
! # ifndef OGS_CREATURES_HUMANOIDS_HUMAN_H
! # define OGS_CREATURES_HUMANOIDS_HUMAN_H
+ # include <ogs/core/Die.h>
# include <ogs/core/details/Maturity.h>
# include <ogs/creatures/Humanoid.h>
! # include <ogs/creatures/humanoids/Namespace.h>
! OGS_BEGIN_CREATURES_HUMANOIDS_NAMESPACE
/**
***************
*** 41,45 ****
* level.
*
! * Human can exist in any campaign setting.
*/
class Human: public ogs::creatures::Humanoid,
--- 42,46 ----
* level.
*
! * Humans can exist in any campaign setting.
*/
class Human: public ogs::creatures::Humanoid,
***************
*** 47,66 ****
public:
unsigned getAdultAge () const;
- const Die& getStartingAge () const;
unsigned getMiddleAge () const;
unsigned getOldAge () const;
unsigned getVenerableAge () const;
! const Die& getMaximumAge () const;
!
! protected:
private:
! static Die _startingAge;
! static Die _maximumAge;
};
/**
* Determine the average adult age for this type of creature. The
* adult age for humans is 15 years.
--- 48,72 ----
public:
+ Human ();
+
unsigned getAdultAge () const;
unsigned getMiddleAge () const;
unsigned getOldAge () const;
unsigned getVenerableAge () const;
! const ogs::core::Die& getMaximumAge () const;
private:
! static ogs::core::Die _maximumAge;
};
/**
+ * Create a new human creature.
+ */
+ inline Human::Human () {
+ // empty constructor body
+ }
+
+ /**
* Determine the average adult age for this type of creature. The
* adult age for humans is 15 years.
***************
*** 73,86 ****
/**
- * Access the die used to roll a random starting age for a PC. The die
- * used to roll starting ages for humans is 1d4.
- *
- * @return 1d4
- */
- inline const Die& Human::getStartingAge () const {
- return (_startingAge);
- }
-
- /**
* Determine the average middle age for this type of creature. The
* middle age for humans is 35 years.
--- 79,82 ----
***************
*** 118,128 ****
* @return 2d20
*/
! inline const Die& Human::getMaximumAge () const {
return (_maximumAge);
}
! OGS_END_CREATURES_NAMESPACE
! # endif /* !defined OGS_HUMAN_H */
#endif /* defined __cplusplus */
--- 114,124 ----
* @return 2d20
*/
! inline const ogs::core::Die& Human::getMaximumAge () const {
return (_maximumAge);
}
! OGS_END_CREATURES_HUMANOIDS_NAMESPACE
! # endif /* !defined OGS_CREATURES_HUMANOIDS_HUMAN_H */
#endif /* defined __cplusplus */
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile.am 23 Mar 2003 22:14:36 -0000 1.1
--- Makefile.am 29 Mar 2003 02:10:35 -0000 1.2
***************
*** 41,44 ****
localedir = $(datadir)/locale
libogs_humanoids_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! libogs_humanoids_la_SOURCES =
--- 41,45 ----
localedir = $(datadir)/locale
libogs_humanoids_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! libogs_humanoids_la_SOURCES = \
! Human.cpp
Index: Namespace.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Namespace.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Namespace.h 23 Mar 2003 22:14:36 -0000 1.1
--- Namespace.h 29 Mar 2003 02:10:35 -0000 1.2
***************
*** 31,43 ****
* @namespace ogs::creatures::humanoids
*
! * A set of common humanoid creatures.
*/
# define OGS_BEGIN_CREATURES_HUMANOIDS_NAMESPACE \
! OGS_BEGIN_NAMESPACE \
! namespace creatures {
# define OGS_END_CREATURES_HUMANOIDS_NAMESPACE \
} \
! OGS_END_NAMESPACE
# endif /* !defined OGS_CREATURES_HUMANOIDS_NAMESPACE_H */
--- 31,43 ----
* @namespace ogs::creatures::humanoids
*
! * A collection of common humanoid creatures.
*/
# define OGS_BEGIN_CREATURES_HUMANOIDS_NAMESPACE \
! OGS_BEGIN_CREATURES_NAMESPACE \
! namespace humanoids {
# define OGS_END_CREATURES_HUMANOIDS_NAMESPACE \
} \
! OGS_END_CREATURES_NAMESPACE
# endif /* !defined OGS_CREATURES_HUMANOIDS_NAMESPACE_H */
|