![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents a polygon in the world map. More...
#include <Polygon.h>
Public Member Functions | |
| Polygon (int points) | |
| Creates a polygon with a number of points. More... | |
| Polygon (const Polygon &other) | |
| Creates a new polygon from an existing one. More... | |
| ~Polygon () | |
| Cleans up the polygon. More... | |
| void | load (const YAML::Node &node) |
| Loads the polygon from YAML. More... | |
| double | getLatitude (int i) const |
| Gets the latitude of a point. More... | |
| void | setLatitude (int i, double lat) |
| Sets the latitude of a point. More... | |
| double | getLongitude (int i) const |
| Gets the longitude of a point. More... | |
| void | setLongitude (int i, double lon) |
| Sets the longitude of a point. More... | |
| Sint16 | getX (int i) const |
| Gets the X coordinate of a point. More... | |
| void | setX (int i, Sint16 x) |
| Sets the X coordinate of a point. More... | |
| Sint16 | getY (int i) const |
| Gets the Y coordinate of a point. More... | |
| void | setY (int i, Sint16 y) |
| Sets the Y coordinate of a point. More... | |
| int | getTexture () const |
| Gets the texture of the polygon. More... | |
| void | setTexture (int tex) |
| Sets the texture of the polygon. More... | |
| int | getPoints () const |
| Gets the number of points of the polygon. More... | |
Represents a polygon in the world map.
Polygons constitute the textured land portions of the X-Com globe and typically have 3-4 points.
| OpenXcom::Polygon::Polygon | ( | int | points | ) |
Creates a polygon with a number of points.
Initializes the polygon with arrays to store each point's coordinates.
| points | Number of points. |
| OpenXcom::Polygon::Polygon | ( | const Polygon & | other | ) |
Creates a new polygon from an existing one.
Performs a deep copy of an existing polygon.
| other | Polygon to copy from. |
| OpenXcom::Polygon::~Polygon | ( | ) |
Cleans up the polygon.
Deletes the arrays from memory.
| double OpenXcom::Polygon::getLatitude | ( | int | i | ) | const |
Gets the latitude of a point.
Returns the latitude of a given point.
| i | Point number (0-max). |
| double OpenXcom::Polygon::getLongitude | ( | int | i | ) | const |
Gets the longitude of a point.
Returns the longitude of a given point.
| i | Point number (0-max). |
| int OpenXcom::Polygon::getPoints | ( | ) | const |
Gets the number of points of the polygon.
Returns the number of points (vertexes) that make up the polygon.
| int OpenXcom::Polygon::getTexture | ( | ) | const |
Gets the texture of the polygon.
Returns the texture used to draw the polygon (textures are stored in a set).
| Sint16 OpenXcom::Polygon::getX | ( | int | i | ) | const |
Gets the X coordinate of a point.
Returns the X coordinate of a given point.
| i | Point number (0-max). |
| Sint16 OpenXcom::Polygon::getY | ( | int | i | ) | const |
Gets the Y coordinate of a point.
Returns the Y coordinate of a given point.
| i | Point number (0-max). |
| void OpenXcom::Polygon::load | ( | const YAML::Node & | node | ) |
Loads the polygon from YAML.
Loads the polygon from a YAML file.
| node | YAML node. |
| void OpenXcom::Polygon::setLatitude | ( | int | i, |
| double | lat | ||
| ) |
Sets the latitude of a point.
Changes the latitude of a given point.
| i | Point number (0-max). |
| lat | Point's latitude. |
| void OpenXcom::Polygon::setLongitude | ( | int | i, |
| double | lon | ||
| ) |
Sets the longitude of a point.
Changes the latitude of a given point.
| i | Point number (0-max). |
| lon | Point's longitude. |
| void OpenXcom::Polygon::setTexture | ( | int | tex | ) |
Sets the texture of the polygon.
Changes the texture used to draw the polygon.
| tex | Texture sprite number. |
| void OpenXcom::Polygon::setX | ( | int | i, |
| Sint16 | x | ||
| ) |
Sets the X coordinate of a point.
Changes the X coordinate of a given point.
| i | Point number (0-max). |
| x | Point's X coordinate. |
| void OpenXcom::Polygon::setY | ( | int | i, |
| Sint16 | y | ||
| ) |
Sets the Y coordinate of a point.
Changes the Y coordinate of a given point.
| i | Point number (0-max). |
| y | Point's Y coordinate. |
1.8.14