Update usage and gitignore to not exlude code folders

This commit is contained in:
Marc Di Luzio 2014-12-16 13:33:11 +00:00
parent 24e17450aa
commit dbfd932a64
3 changed files with 81 additions and 78 deletions

7
.gitignore vendored
View file

@ -1,6 +1,5 @@
build build/
maps maps/
ttrts
*.user *.user
*.sublime* *.sublime*
.idea *.idea

View file

@ -8,22 +8,24 @@ SYNOPSYS
ttrts [OPTIONS...] MAPFILE ttrts [OPTIONS...] MAPFILE
DESCRIPTION DESCRIPTION
ttrts is a tiny terminal based RTS where that uses text files as order lists to control it's units. ttrts is a tiny terminal based RTS where that uses text
files as order lists to control it's units.
This means that any user, program or cat that can read and write to text files can play the game. This means that any user, program or cat that can read
and write to text files can play the game.
USAGE USAGE
When invoked, ttrts will set up a full game and output a single file representing the current gamestate into a local directory called ttrts_{GAME_NAME}. When invoked, ttrts will set up a full game and output a
single file representing the current gamestate into a
local directory called ttrts_{GAME_NAME}.
This file can be read in and interpretted by human, robot, or cat. This file can be read in and interpretted by human, robot
ttrts will wait for orders files to be placed in it's current working directory. or cat. ttrts will wait for orders files to be placed in
it's current working directory.
File name formats: Once orders have been set for each player taking part
gamestate Turn_{TURN_NUMBER}.txt ttrts will calculate the new game state and output a new
orders Turn_{TURN_NUMBER}_Team_{TEAM_NUMBER}.txt gamestate file for the next turn.
Once orders have been set for each player taking part, ttrts consumes order files,
calculates new game state and outputs a new file.
This process repeats until a winner is chosen! This process repeats until a winner is chosen!
@ -33,21 +35,21 @@ OPTIONS
GAMESTATE FILE FORMAT GAMESTATE FILE FORMAT
Name Name
Turn_{TURN_NUMBER}.txt Turn_{TURN_NUMBER}.txt
Contents Contents
===== {GAME_NAME} ===== ===== {GAME_NAME} =====
SIZE:[{X},{Y}] SIZE:[{X},{Y}]
TURN:{TURN_NUMBER} TURN:{TURN_NUMBER}
~~~~ ~~~~
UNIT:{UNIT_ID} tm:{TEAM_NUMBER} vs:{VISUAL} dr:{DIRECTION(NESW)} ps:[{X},{Y}] UNIT:{ID} tm:{TEAM} vs:{VIS} dr:{DIR(NESW)} ps:[{X},{Y}]
... ...
ORDER FILE FORMAT ORDER FILE FORMAT
Name Name
Turn_{TURN_NUMBER}_Team_{TEAM_NUMBER}.txt Turn_{TURN_NUMBER}_Team_{TEAM_NUMBER}.txt
Contents Contents
ORDER:{ORDER_CHAR} id:{UNIT_ID} ORDER:{ORDER_CHAR} id:{UNIT_ID}
... ...
ORDERS ORDERS
F - Move unit forward one space F - Move unit forward one space

View file

@ -7,58 +7,60 @@
#include "game.h" #include "game.h"
static const char* sk_usage = static const char* sk_usage =
"NAME\n" "NAME\n"
"\tttrts - Tiny Terminal RTS\n" "\tttrts - Tiny Terminal RTS\n"
"\n" "\n"
"SYNOPSYS\n" "SYNOPSYS\n"
"\tttrts [OPTIONS...] MAPFILE\n" "\tttrts [OPTIONS...] MAPFILE\n"
"\n" "\n"
"DESCRIPTION\n" "DESCRIPTION\n"
"\tttrts is a tiny terminal based RTS where that uses text files as order lists to control it's units.\n" "\tttrts is a tiny terminal based RTS where that uses text\n"
"\n" "\tfiles as order lists to control it's units.\n"
"\tThis means that any user, program or cat that can read and write to text files can play the game.\n" "\n"
"\n" "\tThis means that any user, program or cat that can read\n"
"USAGE\n" "\tand write to text files can play the game.\n"
"\tWhen invoked, ttrts will set up a full game and output a single file representing the current gamestate into a local directory called ttrts_{GAME_NAME}.\n" "\n"
"\n" "USAGE\n"
"\tThis file can be read in and interpretted by human, robot, or cat.\n" "\tWhen invoked, ttrts will set up a full game and output a\n"
"\tttrts will wait for orders files to be placed in it's current working directory.\n" "\tsingle file representing the current gamestate into a \n"
"\n" "\tlocal directory called ttrts_{GAME_NAME}.\n"
"\tFile name formats:\n" "\n"
"\t gamestate Turn_{TURN_NUMBER}.txt\n" "\tThis file can be read in and interpretted by human, robot\n"
"\t orders Turn_{TURN_NUMBER}_Team_{TEAM_NUMBER}.txt\n" "\tor cat. ttrts will wait for orders files to be placed in \n"
"\n" "\tit's current working directory.\n"
"\tOnce orders have been set for each player taking part, ttrts consumes order files,\n" "\n"
"\tcalculates new game state and outputs a new file.\n" "\tOnce orders have been set for each player taking part \n"
"\n" "\tttrts will calculate the new game state and output a new \n"
"\tThis process repeats until a winner is chosen!\n" "\tgamestate file for the next turn.\n"
"\n" "\n"
"OPTIONS\n" "\tThis process repeats until a winner is chosen!\n"
"\tMAPFILE:\n" "\n"
"\t\tFile to read in the initial game state from\n" "OPTIONS\n"
"\n" "\tMAPFILE:\n"
"GAMESTATE FILE FORMAT\n" "\t\tFile to read in the initial game state from\n"
"\tName\n" "\n"
"\t\tTurn_{TURN_NUMBER}.txt\n" "GAMESTATE FILE FORMAT\n"
"\tContents\n" "\tName\n"
"\t\t===== {GAME_NAME} =====\n" "\t Turn_{TURN_NUMBER}.txt\n"
"\t\tSIZE:[{X},{Y}]\n" "\tContents\n"
"\t\tTURN:{TURN_NUMBER}\n" "\t ===== {GAME_NAME} =====\n"
"\t\t~~~~\n" "\t SIZE:[{X},{Y}]\n"
"\t\tUNIT:{UNIT_ID} tm:{TEAM_NUMBER} vs:{VISUAL} dr:{DIRECTION(NESW)} ps:[{X},{Y}]\n" "\t TURN:{TURN_NUMBER}\n"
"\t\t...\n" "\t ~~~~\n"
"\n" "\t UNIT:{ID} tm:{TEAM} vs:{VIS} dr:{DIR(NESW)} ps:[{X},{Y}]\n"
"ORDER FILE FORMAT\n" "\t ...\n"
"\tName\n" "\n"
"\t\tTurn_{TURN_NUMBER}_Team_{TEAM_NUMBER}.txt\n" "ORDER FILE FORMAT\n"
"\tContents\n" "\tName\n"
"\t\tORDER:{ORDER_CHAR} id:{UNIT_ID}\n" "\t Turn_{TURN_NUMBER}_Team_{TEAM_NUMBER}.txt\n"
"\t\t...\n" "\tContents\n"
"\n" "\t ORDER:{ORDER_CHAR} id:{UNIT_ID}\n"
"ORDERS\n" "\t ...\n"
"\tF - Move unit forward one space\n" "\n"
"\tL/R - Rotate unit left or right\n" "ORDERS\n"
"\tA - Attack space in front of unit\n"; "\tF - Move unit forward one space\n"
"\tL/R - Rotate unit left or right\n"
"\tA - Attack space in front of unit\n";
// time for waiting between file stats // time for waiting between file stats
static const std::chrono::milliseconds sk_waitTime = std::chrono::milliseconds(100); static const std::chrono::milliseconds sk_waitTime = std::chrono::milliseconds(100);
@ -191,4 +193,4 @@ int main(int argc, char* argv[])
std::cout<<"TTRTS: Game over! Winner:"<<(int)winningTeam<<std::endl; std::cout<<"TTRTS: Game over! Winner:"<<(int)winningTeam<<std::endl;
return 0; return 0;
}; };