-void Interface::PrintBlockInfo() {
- std::cout << std::endl;
- if (!aim_world) {
- PostMessage("not looking at any block");
- Ray aim = ctrl.Aim();
- std::stringstream s;
- s << "aim ray: " << aim.orig << ", " << aim.dir;
- PostMessage(s.str());
- return;
- }
- std::stringstream s;
- s << "looking at block " << aim_world.block
- << " " << aim_world.BlockCoords()
- << " of chunk " << aim_world.GetChunk().Position()
- ;
- PostMessage(s.str());
- Print(aim_world.GetBlock());
-}
-
-void Interface::PrintChunkInfo() {
- std::cout << std::endl;
- if (!aim_world) {
- PostMessage("not looking at any block");
- return;
- }
- std::stringstream s;
- s << "looking at chunk " << aim_world.GetChunk().Position();
- PostMessage(s.str());
-
- PostMessage(" neighbors:");
- if (aim_world.GetChunk().HasNeighbor(Block::FACE_LEFT)) {
- s.str("");
- s << " left " << aim_world.GetChunk().GetNeighbor(Block::FACE_LEFT).Position();
- PostMessage(s.str());
- }
- if (aim_world.GetChunk().HasNeighbor(Block::FACE_RIGHT)) {
- s.str("");
- s << " right " << aim_world.GetChunk().GetNeighbor(Block::FACE_RIGHT).Position();
- PostMessage(s.str());
- }
- if (aim_world.GetChunk().HasNeighbor(Block::FACE_UP)) {
- s.str("");
- s << " up " << aim_world.GetChunk().GetNeighbor(Block::FACE_UP).Position();
- PostMessage(s.str());
- }
- if (aim_world.GetChunk().HasNeighbor(Block::FACE_DOWN)) {
- s.str("");
- s << " down " << aim_world.GetChunk().GetNeighbor(Block::FACE_DOWN).Position();
- PostMessage(s.str());
- }
- if (aim_world.GetChunk().HasNeighbor(Block::FACE_FRONT)) {
- s.str("");
- s << " front " << aim_world.GetChunk().GetNeighbor(Block::FACE_FRONT).Position();
- PostMessage(s.str());
- }
- if (aim_world.GetChunk().HasNeighbor(Block::FACE_BACK)) {
- s.str("");
- s << " back " << aim_world.GetChunk().GetNeighbor(Block::FACE_BACK).Position();
- PostMessage(s.str());
- }
- std::cout << std::endl;
-}
-
-void Interface::PrintLightInfo() {
- std::stringstream s;
- s
- << "light level " << world.PlayerChunk().GetLight(world.Player().Position())
- << " at position " << world.Player().Position()
- ;
- PostMessage(s.str());
-}
-
-void Interface::PrintSelectionInfo() {
- std::cout << std::endl;
- Print(selection);
-}
-
-void Interface::Print(const Block &block) {
- std::stringstream s;
- s << "type: " << block.type
- << ", face: " << block.GetFace()
- << ", turn: " << block.GetTurn()
- ;
- PostMessage(s.str());
-}
-