Clean up CXX Flags and remove statements relating to us being cool. If you have to say it, it ain't true
This commit is contained in:
parent
43a2c58c56
commit
7a75fbd369
15 changed files with 110 additions and 57 deletions
|
@ -1,6 +1,13 @@
|
||||||
cmake_minimum_required( VERSION 2.8.7 )
|
cmake_minimum_required( VERSION 2.8.7 )
|
||||||
|
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -Wall -Wno-reorder" )
|
# Use c++1y (14)
|
||||||
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++1y" )
|
||||||
|
|
||||||
|
# Turn on all warnings
|
||||||
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-reorder" )
|
||||||
|
|
||||||
|
# Turn off reorder warnings as they're kind of irrelevant
|
||||||
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder" )
|
||||||
|
|
||||||
if( CMAKE_BUILD_TYPE MATCHES "Debug" )
|
if( CMAKE_BUILD_TYPE MATCHES "Debug" )
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
|
||||||
|
|
|
@ -17,7 +17,7 @@ We aim to create a simple terminal based rts where a user can program an AI to c
|
||||||
5. repeat until an end state is reached
|
5. repeat until an end state is reached
|
||||||
4. once game is finished, host and clients disconnect and a winner is notified
|
4. once game is finished, host and clients disconnect and a winner is notified
|
||||||
|
|
||||||
*see [the game directory](game) for full game rules*
|
*see [game](game) for full game rules*
|
||||||
|
|
||||||
------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------
|
||||||
## Source
|
## Source
|
||||||
|
@ -48,7 +48,7 @@ Wrapper for user interface for the terminal, this only really needs three stages
|
||||||
* Initialise the game with settings and connect the clients
|
* Initialise the game with settings and connect the clients
|
||||||
* Run the game simulation to it's conclusion
|
* Run the game simulation to it's conclusion
|
||||||
* Display the game result
|
* Display the game result
|
||||||
* Acsii Colour wrapper for separate teams
|
* ASCII Colour wrapper for separate teams
|
||||||
|
|
||||||
##### maths
|
##### maths
|
||||||
simple maths library for 2D calculations and types
|
simple maths library for 2D calculations and types
|
||||||
|
|
|
@ -7,9 +7,6 @@ include_directories(
|
||||||
../maths
|
../maths
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set to use c++11, because we're cool like that
|
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11" )
|
|
||||||
|
|
||||||
# Add the sources
|
# Add the sources
|
||||||
set( SOURCES
|
set( SOURCES
|
||||||
game.cpp
|
game.cpp
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
ttrts Game Design
|
ttrts Game Design
|
||||||
=================
|
=================
|
||||||
|
|
||||||
The game takes place in a series of simultanious turns on an arbitrarilly sized 2D board.
|
The game takes place in a series of simultaneous turns on an arbitrarily sized 2D board.
|
||||||
|
|
||||||
Each player is in control of a set number of starting units, each turn recieves data on the status of the board.
|
Each player is in control of a set number of starting units, each turn receives data on the status of the board.
|
||||||
|
|
||||||
Each player must then issue a single command to each unit in thier control.
|
Each player must then issue a single command to each unit in their control.
|
||||||
|
|
||||||
The engine then takes all commands, evaluates all movement first simultaniously, then all other commands.
|
The engine then takes all commands, evaluates all movement first simultaneously, then all other commands.
|
||||||
|
|
||||||
All attempted movement to the same square by two or more units will fail.
|
All attempted movement to the same square by two or more units will fail.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
// Interpret a string of orders
|
// Interpret a string of orders
|
||||||
int CTTRTSGame::IssueOrders( player_id_t player, const std::string& _orders )
|
int CTTRTSGame::IssueOrders( player_id_t player, const std::string& _orders )
|
||||||
|
@ -68,8 +69,8 @@ int CTTRTSGame::IssueOrder( player_id_t player, const COrder& order )
|
||||||
int CTTRTSGame::VerifyPos(uvector2 vec) const
|
int CTTRTSGame::VerifyPos(uvector2 vec) const
|
||||||
{
|
{
|
||||||
// Simply check if within the bounds of our dimensions for now
|
// Simply check if within the bounds of our dimensions for now
|
||||||
if ( ( vec.x >= dimentions.x )
|
if ( ( vec.x >= dimensions.x )
|
||||||
|| ( vec.y >= dimentions.y ) )
|
|| ( vec.y >= dimensions.y ) )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -224,20 +225,19 @@ int CTTRTSGame::SimulateToNextTurn()
|
||||||
int CTTRTSGame::AddUnit( CUnit&& unit )
|
int CTTRTSGame::AddUnit( CUnit&& unit )
|
||||||
{
|
{
|
||||||
// Verify the unit
|
// Verify the unit
|
||||||
const int val = unit.valid();
|
if( !unit.valid() )
|
||||||
if( val )
|
return 1;
|
||||||
return val;
|
|
||||||
|
|
||||||
// Verify if the unit can be placed on the current board
|
// Verify if the unit can be placed on the current board
|
||||||
const uvector2 pos = unit.getPos();
|
const uvector2 pos = unit.getPos();
|
||||||
if( (pos.x >= dimentions.x) || (pos.y >= dimentions.y) )
|
if( (pos.x >= dimensions.x) || (pos.y >= dimensions.y) )
|
||||||
return 1;
|
return 2;
|
||||||
|
|
||||||
// If any unit's position matches, reject this
|
// If any unit's position matches, reject this
|
||||||
for ( const OrderUnitPair& pair: m_OrderUnitPairs )
|
for ( const OrderUnitPair& pair: m_OrderUnitPairs )
|
||||||
{
|
{
|
||||||
if( pair.unit.getPos() == unit.getPos() )
|
if( pair.unit.getPos() == unit.getPos() )
|
||||||
return 2;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the unit with a blank order
|
// Add the unit with a blank order
|
||||||
|
@ -315,3 +315,40 @@ CUnit& CTTRTSGame::GetUnitByID( unit_id_t id )
|
||||||
static CUnit invalid_unit;
|
static CUnit invalid_unit;
|
||||||
return invalid_unit;
|
return invalid_unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if we have a win state
|
||||||
|
Team CTTRTSGame::CheckForWin() const
|
||||||
|
{
|
||||||
|
// Array of units for each Team
|
||||||
|
unsigned int units[(int) Team::NUM_INVALID];
|
||||||
|
memset(units,0,sizeof(units));
|
||||||
|
|
||||||
|
// Count up all the units for each Team
|
||||||
|
for ( const OrderUnitPair& pair : m_OrderUnitPairs )
|
||||||
|
{
|
||||||
|
const int team = (int)pair.unit.getTeam();
|
||||||
|
units[team] += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default winning Team to invalid (no win)
|
||||||
|
Team winningTeam = Team::NUM_INVALID;
|
||||||
|
|
||||||
|
// For each of the teams
|
||||||
|
for ( unsigned int i = 0; i < _countof(units); i++ )
|
||||||
|
{
|
||||||
|
// if there are still units in this Team, and the winning Team hasn't been set
|
||||||
|
if( units[i] > 0 && winningTeam == Team::NUM_INVALID )
|
||||||
|
{
|
||||||
|
winningTeam = (Team)i;
|
||||||
|
}
|
||||||
|
// Otherwise, if there are units in this Team and the winning Team HAS been set
|
||||||
|
else if ( units[i] > 0 )
|
||||||
|
{
|
||||||
|
// Set back to invalid and break out of the loop
|
||||||
|
winningTeam = Team::NUM_INVALID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return winningTeam;
|
||||||
|
}
|
16
game/game.h
16
game/game.h
|
@ -35,7 +35,7 @@ class CTTRTSGame
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CTTRTSGame( ucoord_t c, ucoord_t r )
|
CTTRTSGame( ucoord_t c, ucoord_t r )
|
||||||
: dimentions( {c,r} )
|
: dimensions( c,r )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -72,17 +72,19 @@ public:
|
||||||
// Get orders by index as above
|
// Get orders by index as above
|
||||||
inline const COrder& GetOrdersByIndex( unsigned int i ) const { return m_OrderUnitPairs[i].order; }
|
inline const COrder& GetOrdersByIndex( unsigned int i ) const { return m_OrderUnitPairs[i].order; }
|
||||||
|
|
||||||
// Get dimentions
|
// Get dimensions
|
||||||
inline const uvector2& GetDimentions() const { return dimentions; }
|
inline const uvector2 &GetDimensions() const { return dimensions; }
|
||||||
|
|
||||||
|
// Check for a win, returns invalid for no win state reached
|
||||||
|
// Note: this function will return invalid a draw was reached
|
||||||
|
// best practice would be to call with GetNumUnits() == 0
|
||||||
|
Team CheckForWin() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Verify any order - non-zero is error
|
// Verify any order - non-zero is error
|
||||||
int VerifyOrder( player_id_t player, const COrder& order ) const;
|
int VerifyOrder( player_id_t player, const COrder& order ) const;
|
||||||
|
|
||||||
// Verify any order - non-zero is error
|
|
||||||
int VerifyUnit( const CUnit& unit ) const;
|
|
||||||
|
|
||||||
// Verify Position - non-zero is error
|
// Verify Position - non-zero is error
|
||||||
int VerifyPos( uvector2 vec ) const;
|
int VerifyPos( uvector2 vec ) const;
|
||||||
|
|
||||||
|
@ -99,7 +101,7 @@ private:
|
||||||
CUnitVector m_deadUnits;
|
CUnitVector m_deadUnits;
|
||||||
|
|
||||||
// Dimensions of the game
|
// Dimensions of the game
|
||||||
uvector2 dimentions;
|
uvector2 dimensions;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_GAME_H_
|
#endif //_GAME_H_
|
||||||
|
|
|
@ -4,25 +4,27 @@
|
||||||
#include <limits> // std::numeric_limits
|
#include <limits> // std::numeric_limits
|
||||||
|
|
||||||
// Type for a team IDs
|
// Type for a team IDs
|
||||||
typedef unsigned short team_id_t;
|
enum class Team : char
|
||||||
|
{
|
||||||
|
Red = 0,
|
||||||
|
Blue,
|
||||||
|
Green,
|
||||||
|
Yellow,
|
||||||
|
NUM_INVALID
|
||||||
|
};
|
||||||
|
|
||||||
// Type for player IDs
|
// Type for player IDs
|
||||||
typedef unsigned short player_id_t;
|
typedef unsigned char player_id_t;
|
||||||
|
|
||||||
// Type for unit IDs
|
// Type for unit IDs
|
||||||
typedef unsigned short unit_id_t;
|
typedef unsigned short unit_id_t;
|
||||||
|
|
||||||
// Type for the unit type-id
|
|
||||||
typedef char unitType_c;
|
|
||||||
|
|
||||||
// Typedef for unit visual representations
|
// Typedef for unit visual representations
|
||||||
typedef char unitVis_c;
|
typedef char unitVis_c;
|
||||||
|
|
||||||
// Invalid data for above types
|
// Invalid data for above types
|
||||||
static const team_id_t team_id_invalid = std::numeric_limits<team_id_t>::max();
|
|
||||||
static const player_id_t player_id_invalid = std::numeric_limits<player_id_t>::max();
|
static const player_id_t player_id_invalid = std::numeric_limits<player_id_t>::max();
|
||||||
static const unit_id_t unit_id_invalid = std::numeric_limits<unit_id_t>::max();
|
static const unit_id_t unit_id_invalid = std::numeric_limits<unit_id_t>::max();
|
||||||
static const unitType_c unitType_invalid = std::numeric_limits<unitType_c>::max();
|
|
||||||
static const unitVis_c unitVis_invalid = std::numeric_limits<unitVis_c>::max();
|
static const unitVis_c unitVis_invalid = std::numeric_limits<unitVis_c>::max();
|
||||||
|
|
||||||
#endif //_GAME_TYPES_H_
|
#endif //_GAME_TYPES_H_
|
|
@ -24,7 +24,7 @@ COrder GetOrderFromString( const std::string& _order )
|
||||||
{
|
{
|
||||||
const std::string order_unit = order.substr(0, pos);
|
const std::string order_unit = order.substr(0, pos);
|
||||||
|
|
||||||
ret.unit = atoi( order_unit.c_str() );
|
ret.unit = (unit_id_t)atoi( order_unit.c_str() );
|
||||||
|
|
||||||
// Erase everything up to and including the delimiter
|
// Erase everything up to and including the delimiter
|
||||||
order.erase(0, pos + 1);
|
order.erase(0, pos + 1);
|
||||||
|
|
|
@ -15,7 +15,7 @@ enum class order_c : char
|
||||||
L = 'L',
|
L = 'L',
|
||||||
R = 'R',
|
R = 'R',
|
||||||
A = 'A',
|
A = 'A',
|
||||||
INVALID
|
NUM_INVALID
|
||||||
};
|
};
|
||||||
|
|
||||||
// Container for an order
|
// Container for an order
|
||||||
|
@ -24,7 +24,7 @@ struct COrder
|
||||||
// Base constructor makes invalid order
|
// Base constructor makes invalid order
|
||||||
COrder()
|
COrder()
|
||||||
: unit ( unit_id_invalid )
|
: unit ( unit_id_invalid )
|
||||||
, order ( order_c::INVALID )
|
, order ( order_c::NUM_INVALID )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Unit order is for
|
// Unit order is for
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace
|
||||||
// Plain constructor
|
// Plain constructor
|
||||||
CUnit::CUnit()
|
CUnit::CUnit()
|
||||||
: unit_id ( get_unique_unit_id() )
|
: unit_id ( get_unique_unit_id() )
|
||||||
, team_id ( team_id_invalid )
|
, team_id ( Team::NUM_INVALID )
|
||||||
, unit_vis ( unitVis_invalid )
|
, unit_vis ( unitVis_invalid )
|
||||||
, player_id ( player_id_invalid )
|
, player_id ( player_id_invalid )
|
||||||
, dir ( dir_t::S )
|
, dir ( dir_t::S )
|
||||||
|
|
13
game/unit.h
13
game/unit.h
|
@ -24,15 +24,14 @@ public:
|
||||||
|
|
||||||
// Getters for all the members
|
// Getters for all the members
|
||||||
inline const unit_id_t& getID() const { return unit_id; }
|
inline const unit_id_t& getID() const { return unit_id; }
|
||||||
inline const team_id_t& getTeam() const { return team_id; }
|
inline const Team & getTeam() const { return team_id; }
|
||||||
inline const player_id_t& getPlayer() const { return player_id; }
|
inline const player_id_t& getPlayer() const { return player_id; }
|
||||||
inline const unitVis_c& getVisual() const { return unit_vis; }
|
inline const unitVis_c& getVisual() const { return unit_vis; }
|
||||||
inline const dir_t& getDir() const { return dir; }
|
inline const dir_t& getDir() const { return dir; }
|
||||||
|
|
||||||
// Return non-zero values on error
|
inline Team setTeam(const Team & v) { return (team_id = v); }
|
||||||
inline int setTeam(const team_id_t& v) { return (v == team_id_invalid) ? -1 : (( team_id = v ), 0); }
|
inline player_id_t setPlayer(const player_id_t& v) { return ( player_id = v ); }
|
||||||
inline int setPlayer(const player_id_t& v) { return (v == player_id_invalid) ? -1 : (( player_id = v ), 0); }
|
inline unitVis_c setVisual(const unitVis_c& v) { return ( unit_vis = v ); }
|
||||||
inline int setVisual(const unitVis_c& v) { return (v == unitVis_invalid) ? -1 : (( unit_vis = v ), 0); }
|
|
||||||
|
|
||||||
// Set unit direction
|
// Set unit direction
|
||||||
inline dir_t setDir(const dir_t& v) { return (dir = v); }
|
inline dir_t setDir(const dir_t& v) { return (dir = v); }
|
||||||
|
@ -69,7 +68,7 @@ private:
|
||||||
unitVis_c unit_vis;
|
unitVis_c unit_vis;
|
||||||
|
|
||||||
// Team ID
|
// Team ID
|
||||||
team_id_t team_id;
|
Team team_id;
|
||||||
|
|
||||||
// Owner ID
|
// Owner ID
|
||||||
player_id_t player_id;
|
player_id_t player_id;
|
||||||
|
@ -88,7 +87,7 @@ typedef std::vector< CUnit > CUnitVector;
|
||||||
inline bool CUnit::valid() const
|
inline bool CUnit::valid() const
|
||||||
{
|
{
|
||||||
return (unit_id != unit_id_invalid )
|
return (unit_id != unit_id_invalid )
|
||||||
&& (team_id != team_id_invalid )
|
&& (team_id != Team::NUM_INVALID )
|
||||||
&& (player_id != player_id_invalid)
|
&& (player_id != player_id_invalid)
|
||||||
&& (unit_vis != unitVis_invalid);
|
&& (unit_vis != unitVis_invalid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,11 @@ struct uvector2;
|
||||||
|
|
||||||
struct vector2
|
struct vector2
|
||||||
{
|
{
|
||||||
|
vector2( coord_t _x, coord_t _y )
|
||||||
|
: x(_x)
|
||||||
|
, y(_y)
|
||||||
|
{}
|
||||||
|
|
||||||
coord_t x;
|
coord_t x;
|
||||||
coord_t y;
|
coord_t y;
|
||||||
|
|
||||||
|
@ -27,6 +32,11 @@ struct vector2
|
||||||
|
|
||||||
struct uvector2
|
struct uvector2
|
||||||
{
|
{
|
||||||
|
uvector2( ucoord_t _x, ucoord_t _y )
|
||||||
|
: x(_x)
|
||||||
|
, y(_y)
|
||||||
|
{}
|
||||||
|
|
||||||
ucoord_t x;
|
ucoord_t x;
|
||||||
ucoord_t y;
|
ucoord_t y;
|
||||||
|
|
||||||
|
@ -54,22 +64,19 @@ inline vector2 vecFromDir( dir_t dir )
|
||||||
{
|
{
|
||||||
case dir_t::N:
|
case dir_t::N:
|
||||||
return { 0,1 };
|
return { 0,1 };
|
||||||
break;
|
|
||||||
|
|
||||||
case dir_t::E:
|
case dir_t::E:
|
||||||
return { 1,0 };
|
return { 1,0 };
|
||||||
break;
|
|
||||||
|
|
||||||
case dir_t::S:
|
case dir_t::S:
|
||||||
return { 0,-1 };
|
return { 0,-1 };
|
||||||
break;
|
|
||||||
|
|
||||||
case dir_t::W:
|
case dir_t::W:
|
||||||
return { -1,0 };
|
return { -1,0 };
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return { 0,0 };
|
default:
|
||||||
|
return { 0,0 };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //_VECTOR2_H_
|
#endif //_VECTOR2_H_
|
||||||
|
|
|
@ -13,9 +13,6 @@ set( SOURCES
|
||||||
test.cpp
|
test.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set to use c++11, because we're cool like that
|
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11" )
|
|
||||||
|
|
||||||
# Add the executable
|
# Add the executable
|
||||||
add_executable( ttrts-test ${SOURCES} )
|
add_executable( ttrts-test ${SOURCES} )
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ const char* tests()
|
||||||
CUnit unit = CUnit::getUnitFromVis('^');
|
CUnit unit = CUnit::getUnitFromVis('^');
|
||||||
unit.setPos( {2,2} );
|
unit.setPos( {2,2} );
|
||||||
unit.setPlayer(0);
|
unit.setPlayer(0);
|
||||||
|
unit.setTeam(Team::Red);
|
||||||
|
|
||||||
game.AddUnit(std::move(unit));
|
game.AddUnit(std::move(unit));
|
||||||
}
|
}
|
||||||
|
@ -67,6 +68,7 @@ const char* tests()
|
||||||
CUnit unit = CUnit::getUnitFromVis('^');
|
CUnit unit = CUnit::getUnitFromVis('^');
|
||||||
unit.setPos( {2,2} );
|
unit.setPos( {2,2} );
|
||||||
unit.setPlayer(0);
|
unit.setPlayer(0);
|
||||||
|
unit.setTeam(Team::Red);
|
||||||
|
|
||||||
if( !game.AddUnit(std::move(unit)) )
|
if( !game.AddUnit(std::move(unit)) )
|
||||||
return "Game should have rejected unit placed on the same spot";
|
return "Game should have rejected unit placed on the same spot";
|
||||||
|
@ -86,6 +88,7 @@ const char* tests()
|
||||||
|
|
||||||
unit.setPos( {2,2} );
|
unit.setPos( {2,2} );
|
||||||
unit.setPlayer(0);
|
unit.setPlayer(0);
|
||||||
|
unit.setTeam(Team::Red);
|
||||||
|
|
||||||
if ( game.AddUnit(std::move(unit)) )
|
if ( game.AddUnit(std::move(unit)) )
|
||||||
return "Game failed to add valid unit";
|
return "Game failed to add valid unit";
|
||||||
|
@ -115,7 +118,8 @@ const char* tests()
|
||||||
COrder order;
|
COrder order;
|
||||||
|
|
||||||
unit.setPos( {0,0} );
|
unit.setPos( {0,0} );
|
||||||
unit.setPlayer(0);
|
unit.setPlayer(1);
|
||||||
|
unit.setTeam(Team::Blue);
|
||||||
|
|
||||||
if ( game.AddUnit(std::move(unit)) )
|
if ( game.AddUnit(std::move(unit)) )
|
||||||
return "Game failed to add valid unit";
|
return "Game failed to add valid unit";
|
||||||
|
@ -130,7 +134,8 @@ const char* tests()
|
||||||
CUnit unit = CUnit::getUnitFromVis('<');
|
CUnit unit = CUnit::getUnitFromVis('<');
|
||||||
|
|
||||||
unit.setPos( {1,0} );
|
unit.setPos( {1,0} );
|
||||||
unit.setPlayer(1);
|
unit.setPlayer(2);
|
||||||
|
unit.setTeam(Team::Red);
|
||||||
|
|
||||||
if ( game.AddUnit(std::move(unit)) )
|
if ( game.AddUnit(std::move(unit)) )
|
||||||
return "Game failed to add valid unit";
|
return "Game failed to add valid unit";
|
||||||
|
@ -146,6 +151,9 @@ const char* tests()
|
||||||
|
|
||||||
if ( game.GetUnitByIndex(0).getID() != id )
|
if ( game.GetUnitByIndex(0).getID() != id )
|
||||||
return "Game killed the wrong unit";
|
return "Game killed the wrong unit";
|
||||||
|
|
||||||
|
if ( game.CheckForWin() != Team::Blue )
|
||||||
|
return "Game failed to recognise a win for the right Team";
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -7,8 +7,5 @@ set( SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set to use c++11, because we're cool like that
|
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11" )
|
|
||||||
|
|
||||||
# Add the executable
|
# Add the executable
|
||||||
add_executable( ttrts ${SOURCES} )
|
add_executable( ttrts ${SOURCES} )
|
Loading…
Add table
Add a link
Reference in a new issue