Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef SCRIPT_STORAGE_HPP
00013 #define SCRIPT_STORAGE_HPP
00014
00015 #include "../signs_func.h"
00016 #include "../vehicle_func.h"
00017 #include "../road_type.h"
00018 #include "../group.h"
00019 #include "../goal_type.h"
00020 #include "../story_type.h"
00021
00022 #include "table/strings.h"
00023 #include <vector>
00024
00028 typedef bool (ScriptModeProc)();
00029
00033 class ScriptStorage {
00034 friend class ScriptObject;
00035 private:
00036 ScriptModeProc *mode;
00037 class ScriptObject *mode_instance;
00038 CompanyID root_company;
00039 CompanyID company;
00040
00041 uint delay;
00042 bool allow_do_command;
00043
00044 CommandCost costs;
00045 Money last_cost;
00046 uint last_error;
00047 bool last_command_res;
00048
00049 VehicleID new_vehicle_id;
00050 SignID new_sign_id;
00051 GroupID new_group_id;
00052 GoalID new_goal_id;
00053 StoryPageID new_story_page_id;
00054 StoryPageID new_story_page_element_id;
00055
00056 std::vector<int> callback_value;
00057
00058 RoadType road_type;
00059 RailType rail_type;
00060
00061 void *event_data;
00062 void *log_data;
00063
00064 public:
00065 ScriptStorage() :
00066 mode (NULL),
00067 mode_instance (NULL),
00068 root_company (INVALID_OWNER),
00069 company (INVALID_OWNER),
00070 delay (1),
00071 allow_do_command (true),
00072
00073 last_cost (0),
00074 last_error (STR_NULL),
00075 last_command_res (true),
00076 new_vehicle_id (0),
00077 new_sign_id (0),
00078 new_group_id (0),
00079 new_goal_id (0),
00080 new_story_page_id (0),
00081 new_story_page_element_id(0),
00082
00083 road_type (INVALID_ROADTYPE),
00084 rail_type (INVALID_RAILTYPE),
00085 event_data (NULL),
00086 log_data (NULL)
00087 { }
00088
00089 ~ScriptStorage();
00090 };
00091
00092 #endif