Minor Edits

2016-12-15 22:12:51 +11:00
parent dcb22e456a
commit 8bef582eab
+6 -6
@@ -16,19 +16,19 @@ This takes an `x`, `y`, and `z` parameter (`z` is zero indexed), indicating a ti
bool SetSolid(int x, int y, int b);
```
This takes an `x` and `y` zero indexed parameter, indicating a tile in the map. `b` indicates whether it should be solid (true) or not (false). This function retreives a region with `GetRegion`, then it calls that region's `SetSolid`.
This takes an `x` and `y` parameter, indicating a tile in the map. `b` indicates whether it should be solid (true) or not (false). This function retreives a region with `GetRegion`, then it calls that region's `SetSolid`.
```C++
bool GetSolid(int x, int y);
```
This takes an `x` and `y` zero indexed parameter, indicating a tile in the map. It returns whether it's solid (true) or not (false). This function retreives a region with `GetRegion`, then it calls that region's `GetSolid`.
This takes an `x` and `y` parameter, indicating a tile in the map. It returns whether it's solid (true) or not (false). This function retreives a region with `GetRegion`, then it calls that region's `GetSolid`.
```C++
Region* GetRegion(int x, int y);
```
This is the universal function for accessing a region object. You can pass any integer value as `x` and `y`, and the correct region will be retrieved. First, it calls `FindRegion`. If that fails, it calls `LoadRegion`. Finally, if that fails, it calls `CreateRegion` as a last resort. Therefore, this will always return a `Region` object.
This is the universal function for accessing a `Region` object. You can pass any integer value as `x` and `y`, and the correct region will be retrieved. First, it calls `FindRegion`. If that fails, it calls `LoadRegion`. Finally, if that fails, it calls `CreateRegion` as a last resort. Therefore, this will always return a pointer to a `Region` object.
```C++
Region* FindRegion(int x, int y);
@@ -58,13 +58,13 @@ This will fail, and return nullptr. It's intended for overwriting by RegionPager
Region* CreateRegion(int x, int y);
```
This will create a `Region` object with the coordinates `x` and `y`, add it to the RegionPagerBase, and return it. If an object with those coordinates already exist, it will throw an exception.
This will create a `Region` object with the coordinates `x` and `y`, add it to RegionPagerBase, and return it. If an object with those coordinates already exist, it will throw an exception.
```C++
void UnloadIf(std::function<bool(Region const&)> fn);
```
This takes a function with the prototype `bool f(Region const&)` as a parameter. Each `Region` object that causes that function to return true will be destroyed and removed from the RegionPagerBase.
This takes a function with the prototype `bool f(Region const&)` as a parameter. Each `Region` object that causes that function to return true will be destroyed and removed from RegionPagerBase.
```C++
void UnloadAll();
@@ -76,7 +76,7 @@ This will destroy and unload all `Region` objects.
void ForEach(std::function<void(Region&)> fn);
```
This takes a function with the prototype `void f(Region&)` as a parameter, and passes each `Region` object to it. This is used for applying a certain function to each object inside RegionPagerLua.
This takes a function with the prototype `void f(Region&)` as a parameter, and passes each `Region` object to it, one at a time. This is used for applying a certain function to each object inside RegionPagerBase.
```C++
std::list<Region>* GetContainer();