-
Notifications
You must be signed in to change notification settings - Fork 2
DS_BaseGrid
Inherits: Node
Inherited By ds_grid_rect
Base class for all the stage grid objects.
DS_BaseGrid is the parent/base class for all the stage grid scripts in the tool/plugin Duniya Skapare. This script has been designed in a way that every current or new stage grid shape or algorithm scripts will need to extend from DS_BaseGrid. That way it will be easier to keep the grid types organized and having common parent. This will also help in making sure that the grid scripts can be just dragged and dropped into other scripts that will use the grid script and it will work no matter the different grid script, SOLID principles. Well that is the idea for now.
Type | Name | Default Value |
---|---|---|
int | _grid_x | 3 |
int | _grid_y | 3 |
int | _grid_z | 0 |
bool | _is_start_setup | true |
DS_Tile[] | _tiles |
int _grid_x = 3
The maximum length in the x coordinate. Minimum value of _grid_x
is 1
. Starting x coordinate value is 0
.
int _grid_y = 3
The maximum length in the y coordinate. Minimum value of _grid_y
is 1
. Starting y coordinate value is 0
.
int _grid_z = 0
The maximum length in the z coordinate. Minimum value of _grid_z
is 0
. Starting z coordinate value is 0
.
Note: The _grid_z
is permanently set to 0
because at the moment _grid_z
higher than 0
seems to cause problem in some algorithms. Once issues have been fixed _grid_z
will be enabled again for the user to be set.
bool _is_start_setup = true
This flag checks if the grid should be setup when the application starts. True means the grid will be setup automatically when the application starts. False means the grid will NOT be setup automatically.
Note: If the flag is disabled, meaning automatic setup is disabled, then you MUST call the method setup() manually through other scripts. If the setup() is NOT called then a null error will be thrown.
DS_Tile[] _tiles
An array that contains all the tiles for the grid.
int get_grid_size_x ()
This method gets the x-axis size of the grid which is the _grid_x property.
int get_grid_size_y ()
This method gets the y-axis size of the grid which is the _grid_y property.
int get_grid_size_z ()
This method gets the z-axis size of the grid which is the _grid_z property.
int get_grid_size ()
This method gets the total size of the grid.
int get_tiles_size ()
This method gets the size of _tiles array.
This method gets the indexth tile, DS_Tile.
void add_tile ( DS_Tile tile )
This method adds a tile to the _tiles array.
This method checks if the given tile
exists in the given grid's tiles array and if it does exists then it will return the given tile
otherwise it will return null
.
This method checks if the given tile
exists in the current grid's _tiles array and if it does exists then it will return the given tile
otherwise it will return null
.
This method searches for the x
, y
and z
coordinated tile in the given grid
and returns it.
This method searches for the x
, y
and z
coordinated tile in the _tiles array and returns it.
This method checks if the given tile
exists in the given grid
.
This method checks if the given tile
exists in the _tiles array.
This method checks if the given coordinates x
, y
and z
exists in the given grid
. True
means the tile in the coordinate exists, false
otherwise.
void setup () virtual
This method sets up the grid.
This method sets the custom co-ordinates for the tiles from which the tiles' co-ordinates will start. Default is 0. Example: If -1 is given for x axis and the grid size is 3X3 then the co-ordinates for x will be -1, 0 and 1.
void reset () virtual
This method resets the grid.
This method returns the grid in string format. The gird's _tiles information are shown. Use this for debugging.
This method returns the grid in string format. The gird's _tiles information are shown. It also highlights the index
tile. Use this for debugging.
This method returns the grid in string format. The gird's _tiles information are shown. It also highlights all the given tiles
. The first tile in the array tiles
is highlighted green and the rest are blue. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's rotation information are shown. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's rotation information are shown. It also highlights the index
tile. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's rotation information are shown. It also highlights all the given tiles
. The first tile in the array tiles
is highlighted green and the rest are blue. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's index information are shown. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's index information are shown. It also highlights the index
tile. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's index information are shown. It also highlights all the given tiles
. The first tile in the array tiles
is highlighted green and the rest are blue. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's coordinate information are shown. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's coordinate information are shown. It also highlights the index
tile. Use this for debugging.
This method returns the grid in string format. The gird's _tiles's coordinate information are shown. It also highlights all the given tiles
. The first tile in the array tiles
is highlighted green and the rest are blue. Use this for debugging.
bool _is_grid ()
This method always returns true
as the script is a grid script. This method is needed for duck typing check and SHOULD NOT be OVERRIDDEN!
TOOLS
CLASS REFERENCE
- Generators
-
- Wave Function Collapse
- Grids
- Tiles