1/**
2 * The Forgotten Server - a free and open-source MMORPG server emulator
3 * Copyright (C) 2019 Mark Samman <mark.samman@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#include "otpch.h"
21
22#include "position.h"
23
24std::ostream& operator<<(std::ostream& os, const Position& pos)
25{
26 os << "( " << std::setw(5) << std::setfill('0') << pos.x;
27 os << " / " << std::setw(5) << std::setfill('0') << pos.y;
28 os << " / " << std::setw(3) << std::setfill('0') << pos.getZ();
29 os << " )";
30 return os;
31}
32
33std::ostream& operator<<(std::ostream& os, const Direction& dir)
34{
35 switch (dir) {
36 case DIRECTION_NORTH:
37 os << "North";
38 break;
39
40 case DIRECTION_EAST:
41 os << "East";
42 break;
43
44 case DIRECTION_WEST:
45 os << "West";
46 break;
47
48 case DIRECTION_SOUTH:
49 os << "South";
50 break;
51
52 case DIRECTION_SOUTHWEST:
53 os << "South-West";
54 break;
55
56 case DIRECTION_SOUTHEAST:
57 os << "South-East";
58 break;
59
60 case DIRECTION_NORTHWEST:
61 os << "North-West";
62 break;
63
64 case DIRECTION_NORTHEAST:
65 os << "North-East";
66 break;
67
68 default:
69 break;
70 }
71
72 return os;
73}
74