Colobot
|
Interface for objects that store CBOT programs. More...
#include <program_storage_object.h>
Public Member Functions | |
CProgramStorageObject (ObjectInterfaceTypes &types) | |
virtual bool | IntroduceVirus ()=0 |
virtual void | SetActiveVirus (bool bActive)=0 |
virtual bool | GetActiveVirus ()=0 |
Checks virus active status. | |
virtual bool | ReadProgram (Program *program, const std::string &filename)=0 |
Read program from a given file. | |
virtual bool | WriteProgram (Program *program, const std::string &filename)=0 |
Write program to a given file. | |
virtual bool | GetCompile (Program *program)=0 |
Check if program was compiled successfully. | |
virtual Program * | AddProgram ()=0 |
Add a new program. | |
virtual void | AddProgram (std::unique_ptr< Program > program)=0 |
Add given program to the program list stored in this robot. | |
virtual void | RemoveProgram (Program *program)=0 |
Remove program. | |
virtual Program * | CloneProgram (Program *program)=0 |
Clone a program. | |
virtual std::vector< std::unique_ptr< Program > > & | GetPrograms ()=0 |
Return a std::vector of all available programs. | |
virtual int | GetProgramCount ()=0 |
Return count of all programs. | |
virtual Program * | GetProgram (int index)=0 |
Return program with the given index. | |
virtual Program * | GetOrAddProgram (int index)=0 |
Return program at the given index (creating it and all previous ones as needed) | |
virtual int | GetProgramIndex (Program *program)=0 |
Return index in the list of given Program instance. | |
virtual void | SetProgramStorageIndex (int programStorageIndex)=0 |
Set index for use in filename for saved programs (-1 to disable) | |
virtual int | GetProgramStorageIndex ()=0 |
Return index that is used while saving programs. | |
virtual void | SaveAllUserPrograms (const std::string &userSource)=0 |
Save all user programs. | |
virtual void | LoadAllProgramsForLevel (CLevelParserLine *levelSource, const std::string &userSource, bool loadSoluce)=0 |
Load all programs when loading the level including previously saved user programs. | |
virtual void | SaveAllProgramsForSavedScene (CLevelParserLine *levelSourceLine, const std::string &levelSource)=0 |
Save all programs when saving the saved scene. | |
virtual void | LoadAllProgramsForSavedScene (CLevelParserLine *levelSourceLine, const std::string &levelSource)=0 |
Load all programs when loading the saved scene. | |
Interface for objects that store CBOT programs.
|
pure virtual |
Infects a random program of a robot with virus
Implemented in CProgramStorageObjectImpl.
|
pure virtual |
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)
Implemented in CProgramStorageObjectImpl.