Colobot
Public Member Functions | List of all members
CProgramStorageObjectImpl Class Reference
Inheritance diagram for CProgramStorageObjectImpl:
Inheritance graph
[legend]

Public Member Functions

 CProgramStorageObjectImpl (ObjectInterfaceTypes &types, CObject *object)
 
bool IntroduceVirus () override
 
void SetActiveVirus (bool bActive) override
 
bool GetActiveVirus () override
 Checks virus active status. More...
 
bool ReadProgram (Program *program, const std::string &filename) override
 Read program from a given file. More...
 
bool WriteProgram (Program *program, const std::string &filename) override
 Write program to a given file. More...
 
bool GetCompile (Program *program) override
 Check if program was compiled successfully. More...
 
ProgramAddProgram () override
 Add a new program. More...
 
void AddProgram (std::unique_ptr< Program > program) override
 Add given program to the program list stored in this robot. More...
 
void RemoveProgram (Program *program) override
 Remove program. More...
 
ProgramCloneProgram (Program *program) override
 Clone a program. More...
 
std::vector< std::unique_ptr< Program > > & GetPrograms () override
 Return a std::vector of all available programs. More...
 
int GetProgramCount () override
 Return count of all programs. More...
 
ProgramGetProgram (int index) override
 Return program with the given index. More...
 
ProgramGetOrAddProgram (int index) override
 Return program at the given index (creating it and all previous ones as needed) More...
 
int GetProgramIndex (Program *program) override
 Return index in the list of given Program instance. More...
 
void SetProgramStorageIndex (int programStorageIndex) override
 Set index for use in filename for saved programs (-1 to disable) More...
 
int GetProgramStorageIndex () override
 Return index that is used while saving programs. More...
 
void SaveAllUserPrograms (const std::string &userSource) override
 Save all user programs. More...
 
void LoadAllProgramsForLevel (CLevelParserLine *levelSource, const std::string &userSource, bool loadSoluce) override
 Load all programs when loading the level including previously saved user programs. More...
 
void SaveAllProgramsForSavedScene (CLevelParserLine *levelSourceLine, const std::string &levelSource) override
 Save all programs when saving the saved scene. More...
 
void LoadAllProgramsForSavedScene (CLevelParserLine *levelSourceLine, const std::string &levelSource) override
 Load all programs when loading the saved scene. More...
 
- Public Member Functions inherited from CProgramStorageObject
 CProgramStorageObject (ObjectInterfaceTypes &types)
 

Member Function Documentation

bool CProgramStorageObjectImpl::IntroduceVirus ( )
overridevirtual

Infects a random program of a robot with virus

Returns
true if program was successfully infected, false on failure (no programs or no suitable keywords to infect found)

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::SetActiveVirus ( bool  bActive)
overridevirtual

Sets the virus as active, this controls the "Program infected" message and is cleared after you edit the program. Note that this status is independent from the virus particles (see COldObject::SetVirusMode for that)

Implements CProgramStorageObject.

bool CProgramStorageObjectImpl::GetActiveVirus ( )
overridevirtual

Checks virus active status.

Implements CProgramStorageObject.

bool CProgramStorageObjectImpl::ReadProgram ( Program program,
const std::string &  filename 
)
overridevirtual

Read program from a given file.

Implements CProgramStorageObject.

bool CProgramStorageObjectImpl::WriteProgram ( Program program,
const std::string &  filename 
)
overridevirtual

Write program to a given file.

Implements CProgramStorageObject.

bool CProgramStorageObjectImpl::GetCompile ( Program program)
overridevirtual

Check if program was compiled successfully.

Implements CProgramStorageObject.

Program * CProgramStorageObjectImpl::AddProgram ( )
overridevirtual

Add a new program.

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::AddProgram ( std::unique_ptr< Program program)
overridevirtual

Add given program to the program list stored in this robot.

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::RemoveProgram ( Program program)
overridevirtual

Remove program.

Implements CProgramStorageObject.

Program * CProgramStorageObjectImpl::CloneProgram ( Program program)
overridevirtual

Clone a program.

Implements CProgramStorageObject.

std::vector< std::unique_ptr< Program > > & CProgramStorageObjectImpl::GetPrograms ( )
overridevirtual

Return a std::vector of all available programs.

Implements CProgramStorageObject.

int CProgramStorageObjectImpl::GetProgramCount ( )
overridevirtual

Return count of all programs.

Implements CProgramStorageObject.

Program * CProgramStorageObjectImpl::GetProgram ( int  index)
overridevirtual

Return program with the given index.

Implements CProgramStorageObject.

Program * CProgramStorageObjectImpl::GetOrAddProgram ( int  index)
overridevirtual

Return program at the given index (creating it and all previous ones as needed)

Implements CProgramStorageObject.

int CProgramStorageObjectImpl::GetProgramIndex ( Program program)
overridevirtual

Return index in the list of given Program instance.

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::SetProgramStorageIndex ( int  programStorageIndex)
overridevirtual

Set index for use in filename for saved programs (-1 to disable)

Implements CProgramStorageObject.

int CProgramStorageObjectImpl::GetProgramStorageIndex ( )
overridevirtual

Return index that is used while saving programs.

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::SaveAllUserPrograms ( const std::string &  userSource)
overridevirtual

Save all user programs.

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::LoadAllProgramsForLevel ( CLevelParserLine levelSource,
const std::string &  userSource,
bool  loadSoluce 
)
overridevirtual

Load all programs when loading the level including previously saved user programs.

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::SaveAllProgramsForSavedScene ( CLevelParserLine levelSourceLine,
const std::string &  levelSource 
)
overridevirtual

Save all programs when saving the saved scene.

Implements CProgramStorageObject.

void CProgramStorageObjectImpl::LoadAllProgramsForSavedScene ( CLevelParserLine levelSourceLine,
const std::string &  levelSource 
)
overridevirtual

Load all programs when loading the saved scene.

Implements CProgramStorageObject.


The documentation for this class was generated from the following files: