Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
OpenSkyNet::AI::FileIO Namespace Reference

Write/read AI classes to/from binary files. More...

Functions

template<class T >
int serialize (std::ofstream &fout_, const std::vector< T > &vector_)
 
template<class T >
int assemble (std::ifstream &fin_, std::vector< T > &vector_)
 
template<>
int serialize (std::ofstream &fout_, const std::vector< Premise > &premVector_)
 
template<>
int assemble (std::ifstream &fin_, std::vector< Premise > &premVector_)
 
template<>
int serialize (std::ofstream &fout_, const std::vector< Action > &actVector_)
 
template<>
int assemble (std::ifstream &fin_, std::vector< Action > &actVector_)
 
template<>
int serialize (std::ofstream &fout_, const std::vector< State > &stateVector_)
 
template<>
int assemble (std::ifstream &fin_, std::vector< State > &stateVector_)
 
template<>
int serialize (std::ofstream &fout_, const std::vector< Logic::Rule > &ruleVector_)
 
template<>
int assemble (std::ifstream &fin_, std::vector< Logic::Rule > &ruleVector_)
 

Detailed Description

Write/read AI classes to/from binary files.

Function Documentation

template<>
int OpenSkyNet::AI::FileIO::assemble ( std::ifstream &  fin_,
std::vector< Logic::Rule > &  ruleVector_ 
)

global function for reading in a stl vector of Rules from a binary file. the function returns the number of bytes read

Parameters
fin_the file stream to read from (opened for binary input)
ruleVector_a vector of Rules to store the data (the vector will be cleared before storing the data)
template<>
int OpenSkyNet::AI::FileIO::assemble ( std::ifstream &  fin_,
std::vector< State > &  stateVector_ 
)

global function for reading in a stl vector of States from a binary file. the function returns the number of bytes read.

Parameters
fin_the file stream to read from (opened for binary input)
stateVector_a vector of States to store the data (the vector will be cleared before storing the data)
template<class T >
int OpenSkyNet::AI::FileIO::assemble ( std::ifstream &  fin_,
std::vector< T > &  vector_ 
)

global template function for reading in a stl vector of a base type from a binary file. the function returns the number of bytes read

Parameters
fin_the file stream to read from (opened for binary input)
vector_a vector of base type elements to store the data (the vector will be cleared before storing the data)
template<>
int OpenSkyNet::AI::FileIO::assemble ( std::ifstream &  fin_,
std::vector< Premise > &  premVector_ 
)

global function for reading in a stl vector of Premises from a binary file. the function returns the number of bytes read

Parameters
fin_the file stream to read from (opened for binary input)
premVector_a vector of Premises to store the data (the vector will be cleared before storing the data)
template<>
int OpenSkyNet::AI::FileIO::assemble ( std::ifstream &  fin_,
std::vector< Action > &  actVector_ 
)

global function for reading in a stl vector of Actions from a binary file. the function returns the number of bytes read

Parameters
fin_the file stream to read from (opened for binary input)
actVector_a vector of Actions to store the data (the vector will be cleared before storing the data)
template<>
int OpenSkyNet::AI::FileIO::serialize ( std::ofstream &  fout_,
const std::vector< Logic::Rule > &  ruleVector_ 
)

global function for writing a stl vector of Rules to a binary file. the function returns the number of bytes written

Parameters
fout_the file stream to write to (opened for binary output)
ruleVector_the vector of Rules to write
template<>
int OpenSkyNet::AI::FileIO::serialize ( std::ofstream &  fout_,
const std::vector< State > &  stateVector_ 
)

global function for writing a stl vector of States to a binary file. the function returns the number of bytes written

Parameters
fout_the file stream to write to (opened for binary output)
stateVector_the vector of States to write
template<class T >
int OpenSkyNet::AI::FileIO::serialize ( std::ofstream &  fout_,
const std::vector< T > &  vector_ 
)

global template function for writing a stl vector of a base type to a binary file. the function returns the number of bytes written

Parameters
fout_the file stream to write to (opened for binary output)
vector_the vector to write (base type elements only)
template<>
int OpenSkyNet::AI::FileIO::serialize ( std::ofstream &  fout_,
const std::vector< Premise > &  premVector_ 
)

global function for writing a stl vector of Premises to a binary file. the function returns the number of bytes written

Parameters
fout_the file stream to write to (opened for binary output)
premVector_the vector of Premises to write
template<>
int OpenSkyNet::AI::FileIO::serialize ( std::ofstream &  fout_,
const std::vector< Action > &  actVector_ 
)

global function for writing a stl vector of Actions to a binary file. the function returns the number of bytes written

Parameters
fout_the file stream to write to (opened for binary output)
actVector_the vector of Actions to write