save signs in snapshots

This commit is contained in:
jacob1 2013-01-07 17:54:10 -05:00
parent 5e20dd8545
commit 986173af4c
2 changed files with 5 additions and 1 deletions

View File

@ -293,6 +293,7 @@ Snapshot * Simulation::CreateSnapshot()
snap->stickmen.push_back(player2); snap->stickmen.push_back(player2);
snap->stickmen.push_back(player); snap->stickmen.push_back(player);
snap->stickmen.insert(snap->stickmen.begin(), &fighters[0], &fighters[255]); snap->stickmen.insert(snap->stickmen.begin(), &fighters[0], &fighters[255]);
snap->signs = signs;
return snap; return snap;
} }
@ -317,6 +318,7 @@ void Simulation::Restore(const Snapshot & snap)
std::copy(snap.stickmen.begin(), snap.stickmen.end()-2, &fighters[0]); std::copy(snap.stickmen.begin(), snap.stickmen.end()-2, &fighters[0]);
player = snap.stickmen[snap.stickmen.size()-1]; player = snap.stickmen[snap.stickmen.size()-1];
player2 = snap.stickmen[snap.stickmen.size()-2]; player2 = snap.stickmen[snap.stickmen.size()-2];
signs = snap.signs;
} }
/*int Simulation::Load(unsigned char * data, int dataLength) /*int Simulation::Load(unsigned char * data, int dataLength)

View File

@ -29,6 +29,7 @@ public:
std::vector<float> FanVelocityY; std::vector<float> FanVelocityY;
std::vector<playerst> stickmen; std::vector<playerst> stickmen;
std::vector<sign> signs;
Snapshot() : Snapshot() :
AirPressure(), AirPressure(),
@ -46,7 +47,8 @@ public:
ElecMap(), ElecMap(),
FanVelocityX(), FanVelocityX(),
FanVelocityY(), FanVelocityY(),
stickmen() stickmen(),
signs()
{ {
} }