Loading

Paste #pcgfb4o2f

  1. uint32 RoadTypeIdentifier::Pack() const
  2. {
  3.     assert(this->basetype < ROADTYPE_END);
  4.     assert(this->subtype < ROADSUBTYPE_END);
  5.  
  6.     return (this->basetype << ROADSUBTYPE_END) | this->subtype;
  7. }
  8.  
  9. bool RoadTypeIdentifier::Unpack(uint32 data) {
  10.     this->basetype = (RoadType)GB(data, 0, ROADTYPE_END);
  11.     this->subtype = (RoadType)GB(data, ROADTYPE_END, ROADSUBTYPE_END);
  12.  
  13.     return (this->subtype < ROADSUBTYPE_END) && (this->basetype < ROADTYPE_END);
  14. }

Comments