undo/redo for editing item shortcuts
This commit is contained in:
@@ -649,4 +649,15 @@ std::string cScenario::get_sdf_name(int row, int col) {
|
||||
if(sdf_names[row].find(col) == sdf_names[row].end())
|
||||
return "";
|
||||
return sdf_names[row][col];
|
||||
}
|
||||
}
|
||||
|
||||
bool cScenario::cItemStorage::operator==(const cScenario::cItemStorage& other) const {
|
||||
CHECK_EQ(other, ter_type);
|
||||
CHECK_EQ(other, property);
|
||||
for(int i = 0; i < 10; ++i){
|
||||
if(item_num[i] != other.item_num[i]) return false;
|
||||
if(item_odds[i] != other.item_odds[i]) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -87,6 +87,8 @@ public:
|
||||
short property;
|
||||
cItemStorage();
|
||||
cItemStorage& operator = (legacy::item_storage_shortcut_type& old);
|
||||
bool operator==(const cItemStorage& other) const;
|
||||
bool operator!=(const cItemStorage& other) { return !(*this == other); }
|
||||
};
|
||||
void destroy_terrain();
|
||||
public:
|
||||
|
Reference in New Issue
Block a user