22 #include "object/interface/program_storage_object.h" 45 void AddProgram(std::unique_ptr<Program> program)
override;
49 std::vector<std::unique_ptr<Program>>&
GetPrograms()
override;
68 std::vector<std::unique_ptr<Program>> m_program;
72 int m_programStorageIndex;
73 bool m_allowProgramSave;
bool WriteProgram(Program *program, const std::string &filename) override
Write program to a given file.
Definition: program_storage_impl.cpp:194
void SetActiveVirus(bool bActive) override
Definition: program_storage_impl.cpp:85
void RemoveProgram(Program *program) override
Remove program.
Definition: program_storage_impl.cpp:118
bool ReadProgram(Program *program, const std::string &filename) override
Read program from a given file.
Definition: program_storage_impl.cpp:187
int GetProgramStorageIndex() override
Return index that is used while saving programs.
Definition: program_storage_impl.cpp:213
int GetProgramCount() override
Return count of all programs.
Definition: program_storage_impl.cpp:146
Program * GetOrAddProgram(int index) override
Return program at the given index (creating it and all previous ones as needed)
Definition: program_storage_impl.cpp:171
void LoadAllProgramsForLevel(CLevelParserLine *levelSource, const std::string &userSource, bool loadSoluce) override
Load all programs when loading the level including previously saved user programs.
Definition: program_storage_impl.cpp:253
Definition: parserline.h:37
bool IntroduceVirus() override
Definition: program_storage_impl.cpp:68
void LoadAllProgramsForSavedScene(CLevelParserLine *levelSourceLine, const std::string &levelSource) override
Load all programs when loading the saved scene.
Definition: program_storage_impl.cpp:361
int GetProgramIndex(Program *program) override
Return index in the list of given Program instance.
Definition: program_storage_impl.cpp:151
Interface for objects that store CBOT programs.
Definition: program_storage_object.h:43
bool GetCompile(Program *program) override
Check if program was compiled successfully.
Definition: program_storage_impl.cpp:201
void SaveAllUserPrograms(const std::string &userSource) override
Save all user programs.
Definition: program_storage_impl.cpp:218
std::vector< std::unique_ptr< Program > > & GetPrograms() override
Return a std::vector of all available programs.
Definition: program_storage_impl.cpp:141
Vector struct and related functions.
bool GetActiveVirus() override
Checks virus active status.
Definition: program_storage_impl.cpp:95
Definition: program_storage_impl.h:30
Program * AddProgram() override
Add a new program.
Definition: program_storage_impl.cpp:101
void SetProgramStorageIndex(int programStorageIndex) override
Set index for use in filename for saved programs (-1 to disable)
Definition: program_storage_impl.cpp:208
Program * CloneProgram(Program *program) override
Clone a program.
Definition: program_storage_impl.cpp:128
Base class for all 3D in-game objects.
Definition: object.h:63
void SaveAllProgramsForSavedScene(CLevelParserLine *levelSourceLine, const std::string &levelSource) override
Save all programs when saving the saved scene.
Definition: program_storage_impl.cpp:316
Program * GetProgram(int index) override
Return program with the given index.
Definition: program_storage_impl.cpp:163
Definition: program_storage_object.h:31