Commit a3b2cc2a authored by Chae Ho Shin's avatar Chae Ho Shin

do you know SR?

parent 185b3e23
No preview for this file type
...@@ -14,19 +14,21 @@ namespace flatland { ...@@ -14,19 +14,21 @@ namespace flatland {
class Flatlandobject class Flatlandobject
{ {
Flatlandobject(std::vector<int> theparts, std::tuple<State, double, int> initialstate, Mainworldobserver* thegame) Flatlandobject(std::vector<int> theparts, std::tuple<State, double, double, int, int, int> initialstate, Mainworldobserver* thegame)
{ {
parts = theparts; parts = theparts;
objecthistory.push_back(initialstate); objecthistory.push_back(initialstate);
thegame->objectlist.push_back(std::make_tuple(*this, std::get<2>(initialstate))); thegame->objectlist.push_back(std::make_tuple(*this, std::get<3>(initialstate)));
} }
public: public:
std::vector<int> parts = {}; std::vector<int> parts = {};
std::vector<std::tuple<State, double, int>> objecthistory = {}; std::vector<std::tuple<State, double, double, int, int, int>> objecthistory = {};
// state, time(in main observer clock) at statechange, proper time clock at state change, location(in main observer coordinates) at state change,
// velocity(if inertial) relative to mainobserver, proper acceleration(if accelerating)
double propertime; double propertime;
int velocity; int currentvelocity;
int properacceleration; int currentproperacceleration;
auto getcenterofmass() -> int auto getcenterofmass() -> int
...@@ -41,6 +43,11 @@ namespace flatland { ...@@ -41,6 +43,11 @@ namespace flatland {
}; };
class Player : public Flatlandobject
{
};
class Mainworldobserver class Mainworldobserver
{ {
public: public:
...@@ -59,11 +66,12 @@ namespace flatland { ...@@ -59,11 +66,12 @@ namespace flatland {
this->currenttime += tick; this->currenttime += tick;
for (std::tuple<Flatlandobject, int> a: this->objectlist) for (std::tuple<Flatlandobject, int> a: this->objectlist)
{ {
std::get<0>(a).changestate(this->currenttime); auto theobject = std::get<0>(a);
theobject.changestate(this->currenttime);
if (std::get<0>(std::get<0>(a).objecthistory.back()) == INERTIAL) auto objectstate = theobject.objecthistory.back();
if (std::get<0>(objectstate) == INERTIAL)
{ {
auto newx = std::get<3>(objectstate) + ;
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment