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


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