[ogs-changes] dist/c++/ogs/core/moves Burrow.h,NONE,1.1 Fly.h,NONE,1.1 Makefile.am,NONE,1.1 Namespac
Status: Alpha
Brought to you by:
elemings
|
From: <ele...@us...> - 2003-05-02 19:06:39
|
Update of /cvsroot/ogs/dist/c++/ogs/core/moves
In directory sc8-pr-cvs1:/tmp/cvs-serv32451/ogs/core/moves
Added Files:
Burrow.h Fly.h Makefile.am Namespace.h Walk.h
Log Message:
See C++ ChangeLog (May 2) for details.
--- NEW FILE: Burrow.h ---
/*
* Burrow.h -- class interface for burrowing moves
* 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: Burrow.h,v 1.1 2003/05/02 19:06:31 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CORE_MOVES_BURROW_H
# define OGS_CORE_MOVES_BURROW_H
# include <ogs/core/Move.h>
# include <ogs/core/moves/Namespace.h>
OGS_BEGIN_CORE_MOVES_NAMESPACE
/**
* A mode of movement based on burrowing. Some creatures that can move
* by burrowing can move through solid rock while others can not.
*/
class Burrow: public ogs::core::Move {
public:
Burrow (Speed speed, bool throughSolidRock = false);
bool throughSolidRock () const;
private:
bool _throughSolidRock;
};
/**
* Create a new burrow move.
*
* @param speed Normal speed of move.
* @param throughSolidRock True if move can burrow through solid rock.
*/
inline
Burrow::Burrow (Speed speed, bool throughSolidRock):
Move (BURROW, speed),
_throughSolidRock (throughSolidRock) {
// empty constructor body
}
/**
* Determine if this move can burrow through solid rock.
*
* @return True if a this move can burrow through solid rock.
*/
inline bool
Burrow::throughSolidRock () const {
return (this->_throughSolidRock);
}
OGS_END_CORE_MOVES_NAMESPACE
# endif /* !defined OGS_CORE_MOVES_BURROW_H */
#endif /* defined __cplusplus */
--- NEW FILE: Fly.h ---
/*
* Fly.h -- class interface for templates
* 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: Fly.h,v 1.1 2003/05/02 19:06:31 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CORE_MOVES_FLY_H
# define OGS_CORE_MOVES_FLY_H
# include <ogs/core/moves/Namespace.h>
OGS_BEGIN_CORE_MOVES_NAMESPACE
/**
* A mode of movement based on flying. Some creatures can fly better
* than others as specified by a maneuverability class.
*/
class Fly: public ogs::core::Move {
public:
/**
* An enumerated type that represents maneuverability class.
* Maneuverability class determines how well the creature can fly in
* three dimensions (straight, side to side, up or down, and
* backwards).
*/
enum Maneuver {
/**
* An integer constant that indicates perfect maneuverability. A
* creature with perfect maneuverability can stop on a dime, hover
* at will, turn in an instant, and take off in any direction like
* a hummingbird.
*/
PERFECT = 1,
GOOD,
AVERAGE,
POOR,
/**
* An integer constant that indicates clumsy maneuverability. A
* clumsy maneuverability class is a creature that can barely fly.
* This usually includes creatures that can only glide through the
* air.
*/
CLUMSY
};
Fly (Speed speed, Maneuver maneuver);
Maneuver getManeuver () const;
private:
Maneuver _maneuver;
};
/**
* Create a new fly move.
*
* @param speed Normal speed of move.
* @param maneuver Maneuverability class of move.
*/
inline
Fly::Fly (Speed speed, Maneuver maneuver):
Move (FLY, speed),
_maneuver (maneuver) {
// empty constructor body
}
/**
* Determine the maneuverability class of this fly move.
*
* @return Maneuverability class of this fly move.
*/
inline Fly::Maneuver
Fly::getManeuver () const {
return (this->_maneuver);
}
OGS_END_CORE_MOVES_NAMESPACE
# endif /* !defined OGS_CORE_MOVES_FLY_H */
#endif /* defined __cplusplus */
--- NEW FILE: Makefile.am ---
##
## Makefile.am -- Automake file for Open Gaming System (OGS)
## 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: Makefile.am,v 1.1 2003/05/02 19:06:31 elemings Exp $
##
pkgincludedir = $(includedir)/ogs/core/moves
pkginclude_HEADERS = \
Burrow.h \
Fly.h \
Namespace.h \
Walk.h
--- NEW FILE: Namespace.h ---
/*
* Namespace.h -- namespace for extended moves
* Copyright (C) 2002 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: Namespace.h,v 1.1 2003/05/02 19:06:31 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CORE_MOVES_NAMESPACE_H
# define OGS_CORE_MOVES_NAMESPACE_H
# include <ogs/core/Namespace.h>
/**
* @namespace ogs::core::moves
*
* Contains extended move classes.
*/
# define OGS_BEGIN_CORE_MOVES_NAMESPACE \
OGS_BEGIN_CORE_NAMESPACE \
namespace moves {
# define OGS_END_CORE_MOVES_NAMESPACE \
} \
OGS_END_CORE_NAMESPACE
# endif /* !defined OGS_CORE_MOVES_NAMESPACE_H */
#endif /* defined __cplusplus */
--- NEW FILE: Walk.h ---
/*
* Walk.h -- class interface for land-based movement
* 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: Walk.h,v 1.1 2003/05/02 19:06:31 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CORE_MOVES_WALK_H
# define OGS_CORE_MOVES_WALK_H
# include <ogs/core/Move.h>
# include <ogs/core/moves/Namespace.h>
OGS_BEGIN_CORE_MOVES_NAMESPACE
/**
* A mode of movement based on walking. These modes can include
* running, crawling, hopping, rolling, or any other similar move.
* Most creatures that can move by walking can also run but some
* can not.
*/
class Walk: public ogs::core::Move {
public:
Walk (Speed speed, bool canRun = true);
bool canRun () const;
private:
bool _canRun;
};
/**
* Create a new walk move.
*
* @param speed Normal speed of move.
* @param canRun True if a creature with this move can also run.
*/
inline
Walk::Walk (Speed speed, bool canRun):
Move (WALK, speed),
_canRun (canRun) {
// empty constructor body
}
/**
* Determine if a creature with this move can also run.
*
* @return True if a creature with this move can also run.
*/
inline bool
Walk::canRun () const {
return (this->_canRun);
}
OGS_END_CORE_MOVES_NAMESPACE
# endif /* !defined OGS_CORE_MOVES_WALK_H */
#endif /* defined __cplusplus */
|