BZFlag-Dev / bzflag.org

The bzflag.org static website
https://www.bzflag.org
MIT License
8 stars 7 forks source link

Created bz_Time documentation #35

Closed Zehra closed 4 years ago

Zehra commented 4 years ago

Documentation for the "bz_Time" API type which is undocumented.

jwmelto commented 4 years ago

Not having the API memorized, is this a type that exists, or one that you are proposing? I did a quick search of the include directory and it didn't jump out at me.

As a type, it's awful, with too many underspecified fields (e.g., month should be an enumeration, not an unbounded int (what is a negative month anyway?). Since we have C++11, I would recommend using the std::chrono types and not re-invent the wheel. But if this is an existing type and you are just documenting what is, then I guess this is a discussion for another day.

Zehra commented 4 years ago

It's specified in "include/bzfsAPI.h" as the following section of code:

typedef struct {
  int year;
  int month;
  int day;
  int hour;
  int minute;
  int second;
  int dayofweek;
  bool daylightSavings;
} bz_Time;

Referenced in bzfsAPI.h