Changeset d05086b in network-game for common/Common.cpp
- Timestamp:
- Aug 1, 2013, 1:56:17 AM (12 years ago)
- Branches:
- master
- Children:
- 8271c78
- Parents:
- b35b2b2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Common.cpp
rb35b2b2 rd05086b 1 1 #include "Common.h" 2 2 3 #include < iostream>3 #include <sstream> 4 4 #include <cmath> 5 5 … … 7 7 #include <Windows.h> 8 8 #elif defined LINUX 9 #include < time.h>9 #include <ctime> 10 10 #endif 11 11 12 12 using namespace std; 13 14 /*15 FLOAT_POSITION POSITION::toFloat() {16 FLOAT_POSITION floatPosition;17 floatPosition.x = x;18 floatPosition.y = y;19 20 return floatPosition;21 }22 */23 13 24 14 void set_nonblock(int sock) … … 51 41 } 52 42 43 string getCurrentDateTimeString() { 44 time_t millis = time(NULL); 45 struct tm *time = localtime(&millis); 46 47 ostringstream timeString; 48 timeString << time->tm_hour << ":" << time->tm_min << ":"<< time->tm_sec << " " << (time->tm_mon+1) << "/" << time->tm_mday << "/" << (time->tm_year+1900); 49 50 return timeString.str(); 51 } 52 53 53 float posDistance(FLOAT_POSITION pos1, FLOAT_POSITION pos2) { 54 54 float xDiff = pos2.x - pos1.x;
Note:
See TracChangeset
for help on using the changeset viewer.