[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Camino-devel] camino/src/common Tile.h Tile.cpp
From: |
Pascal Audoux |
Subject: |
[Camino-devel] camino/src/common Tile.h Tile.cpp |
Date: |
Sat, 25 Jan 2003 13:46:18 -0500 |
CVSROOT: /cvsroot/camino
Module name: camino
Changes by: Pascal Audoux <address@hidden> 03/01/25 13:46:18
Modified files:
src/common : Tile.h Tile.cpp
Log message:
add basic attributes and methods for Tile
Patches:
Index: camino/src/common/Tile.cpp
diff -u camino/src/common/Tile.cpp:1.1 camino/src/common/Tile.cpp:1.2
--- camino/src/common/Tile.cpp:1.1 Thu Jan 16 17:45:43 2003
+++ camino/src/common/Tile.cpp Sat Jan 25 13:46:18 2003
@@ -2,7 +2,7 @@
**
** Camino
**
-** Version : $Id: Tile.cpp,v 1.1 2003/01/16 22:45:43 Audoux Exp $
+** Version : $Id: Tile.cpp,v 1.2 2003/01/25 18:46:18 Audoux Exp $
**
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 14/01/2003
@@ -30,7 +30,14 @@
/** add comments here */
Tile::Tile()
{
- // internal comments
-
+ _row = -1;
+ _col = -1;
+ _type = TILE_UNKNOWN;
+}
+
+void Tile::setPosition( int row, int col )
+{
+ setRow( row );
+ setCol( col );
}
Index: camino/src/common/Tile.h
diff -u camino/src/common/Tile.h:1.1 camino/src/common/Tile.h:1.2
--- camino/src/common/Tile.h:1.1 Thu Jan 16 17:45:43 2003
+++ camino/src/common/Tile.h Sat Jan 25 13:46:18 2003
@@ -5,7 +5,7 @@
** Tile.h
** Manage a tile on the board game
**
-** Version : $Id: Tile.h,v 1.1 2003/01/16 22:45:43 Audoux Exp $
+** Version : $Id: Tile.h,v 1.2 2003/01/25 18:46:18 Audoux Exp $
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 16/01/2003
** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -45,6 +45,42 @@
public:
/** Constructor */
Tile();
+
+ enum TileType {
+ TILE_UNKNOWN,
+ TILE_ROAD_STRAIGHT,
+ TILE_ROAD_T,
+ TILE_ROAD_BAGEND,
+ TILE_RAIL_TURN,
+ TILE_ROAD_RAIL,
+ TILE_RIVER_STRAIGHT,
+ TILE_ROAD_RIVER,
+ TILE_ROAD_TURN,
+ TILE_ROAD_CROSS,
+ TILE_FOREST,
+ TILE_RAIL_STRAIGHT,
+ TILE_RAIL_BAGEND,
+ TILE_RIVER_TURN,
+ TILE_PLAIN
+ };
+
+ TileType getType() { return _type; }
+
+ void setType( TileType type ) { _type = type; }
+
+ int getRow() { return _row; }
+
+ int getCol() { return _col; }
+
+ void setPosition( int row, int col );
+
+ void setRow( int row ) { _row = row; }
+
+ void setCol( int col ) { _col = col; }
+
+protected:
+ int _row, _col;
+ TileType _type;
};
#endif // TILE_H
- [Camino-devel] camino/src/common Tile.h Tile.cpp,
Pascal Audoux <=