4ab1ccb67807bd37805b33015733a69f6ec90a5a
[supertux.git] / src / direction.cpp
1 //  $Id: direction.hpp 5006 2007-05-23 15:27:56Z tuxdev $
2 //
3 //  SuperTux
4 //  Copyright (C) 2008 Ryan Flegel <rflegel@gmail.com>
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 //
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 //  02111-1307, USA.
20
21 #include "direction.hpp"
22
23 std::ostream& operator<<(std::ostream& o, const Direction& dir)
24 {
25     switch (dir)
26     {
27         case AUTO:
28             o << "auto";
29             break;
30         case LEFT:
31             o << "left";
32             break;
33         case RIGHT:
34             o << "right";
35             break;
36         case UP:
37             o << "up";
38             break;
39         case DOWN:
40             o << "down";
41             break;
42     }
43
44     return o;
45 }