Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TileSize Struct Reference

How many tiles are occupied by a building. More...

#include <tileData.hxx>

+ Collaboration diagram for TileSize:

Public Member Functions

 TileSize ()
 
 TileSize (unsigned int width, unsigned int height)
 
 TileSize (const TileSize &other)
 
TileSizeoperator= (const TileSize &other)
 
bool operator== (const TileSize &other) const
 
const bool operator< (const TileSize &other)
 
size_t operator() (const TileSize &TileSizeToHash) const noexcept
 

Public Attributes

unsigned int width
 
unsigned int height
 

Detailed Description

How many tiles are occupied by a building.

Definition at line 86 of file tileData.hxx.

Constructor & Destructor Documentation

◆ TileSize() [1/3]

TileSize::TileSize ( )
inline

Definition at line 91 of file tileData.hxx.

91 : width(1), height(1){};

◆ TileSize() [2/3]

TileSize::TileSize ( unsigned int  width,
unsigned int  height 
)
inline

Definition at line 92 of file tileData.hxx.

92 : width(width), height(height){};

◆ TileSize() [3/3]

TileSize::TileSize ( const TileSize other)
inline

Definition at line 93 of file tileData.hxx.

93 : width(other.width), height(other.height){};

Member Function Documentation

◆ operator()()

size_t TileSize::operator() ( const TileSize TileSizeToHash) const
inlinenoexcept

Definition at line 119 of file tileData.hxx.

120  {
121  size_t hash = TileSizeToHash.width + 10 * TileSizeToHash.height;
122  return hash;
123  };

◆ operator<()

const bool TileSize::operator< ( const TileSize other)
inline

Definition at line 109 of file tileData.hxx.

110  {
111  if (width < other.width)
112  return true;
113  else if (width == other.width && height == other.height)
114  return true;
115 
116  return false;
117  };

◆ operator=()

TileSize& TileSize::operator= ( const TileSize other)
inline

Definition at line 95 of file tileData.hxx.

96  {
97  width = other.width;
98  height = other.height;
99  return *this;
100  };

◆ operator==()

bool TileSize::operator== ( const TileSize other) const
inline

Definition at line 102 of file tileData.hxx.

103  {
104  if (width == other.width && height == other.height)
105  return true;
106  return false;
107  };

Member Data Documentation

◆ height

unsigned int TileSize::height

Definition at line 89 of file tileData.hxx.

◆ width

unsigned int TileSize::width

Definition at line 88 of file tileData.hxx.


The documentation for this struct was generated from the following file:
TileSize::height
unsigned int height
Definition: tileData.hxx:89
TileSize::width
unsigned int width
Definition: tileData.hxx:88