Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
sthalik committed Jan 13, 2024
1 parent 71fbc60 commit 36c5c7e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,33 @@ chunk& test_app::make_test_chunk(world& w, chunk_coords_ ch)
w.make_object<scenery>(w.make_id(), {ch, {3, 4}}, table);
w.make_object<scenery>(w.make_id(), {ch, {K, K+1}}, control_panel);

#if 0
const auto add_player = [&](StringView name, Vector2i coord, bool playable) {
critter_proto cproto;
cproto.name = name;
cproto.playable = playable;
w.make_object<critter>(w.make_id(), global_coords{ch, {coord.x(), coord.y()}}, cproto);
};

add_player("Player 1", {10, 9}, true);
add_player("Player 2", {10, 9}, false);
add_player("Player 3", {10, 9}, true);
#endif

{
auto& e = *w.make_object<scenery>(w.make_id(), {ch, {K+3, K+1}}, door);
fm_assert(e.frame == e.atlas->info().nframes-1);
const auto index = e.index();
const auto end = e.atlas->info().nframes-1;
fm_assert(e.frame == end);
fm_assert(!e.active);
e.activate(e.index());
fm_assert(e.active);
e.update(index, 1.f/60);
fm_assert(e.frame != end);
for (int i = 0; i < 60*3; i++)
e.update(index, 1.f/60);
fm_assert(e.frame == 0);
fm_assert(!e.active);

}
return c;
}
Expand Down

0 comments on commit 36c5c7e

Please sign in to comment.