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:192
void SetActiveVirus(bool bActive) override
Definition: program_storage_impl.cpp:83
void RemoveProgram(Program *program) override
Remove program.
Definition: program_storage_impl.cpp:116
bool ReadProgram(Program *program, const std::string &filename) override
Read program from a given file.
Definition: program_storage_impl.cpp:185
int GetProgramStorageIndex() override
Return index that is used while saving programs.
Definition: program_storage_impl.cpp:211
int GetProgramCount() override
Return count of all programs.
Definition: program_storage_impl.cpp:144
Program * GetOrAddProgram(int index) override
Return program at the given index (creating it and all previous ones as needed)
Definition: program_storage_impl.cpp:169
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:238
Definition: parserline.h:37
bool IntroduceVirus() override
Definition: program_storage_impl.cpp:66
void LoadAllProgramsForSavedScene(CLevelParserLine *levelSourceLine, const std::string &levelSource) override
Load all programs when loading the saved scene.
Definition: program_storage_impl.cpp:331
int GetProgramIndex(Program *program) override
Return index in the list of given Program instance.
Definition: program_storage_impl.cpp:149
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:199
void SaveAllUserPrograms(const std::string &userSource) override
Save all user programs.
Definition: program_storage_impl.cpp:216
std::vector< std::unique_ptr< Program > > & GetPrograms() override
Return a std::vector of all available programs.
Definition: program_storage_impl.cpp:139
Vector struct and related functions.
bool GetActiveVirus() override
Checks virus active status.
Definition: program_storage_impl.cpp:93
Definition: program_storage_impl.h:30
Program * AddProgram() override
Add a new program.
Definition: program_storage_impl.cpp:99
void SetProgramStorageIndex(int programStorageIndex) override
Set index for use in filename for saved programs (-1 to disable)
Definition: program_storage_impl.cpp:206
Program * CloneProgram(Program *program) override
Clone a program.
Definition: program_storage_impl.cpp:126
Base class for all 3D in-game objects.
Definition: object.h:59
void SaveAllProgramsForSavedScene(CLevelParserLine *levelSourceLine, const std::string &levelSource) override
Save all programs when saving the saved scene.
Definition: program_storage_impl.cpp:296
Program * GetProgram(int index) override
Return program with the given index.
Definition: program_storage_impl.cpp:161
Definition: program_storage_object.h:31