Prepare 1.0 alpha3 release.
[tagua/yd.git] / src / pathinfo.h
blobc012191b3763c8fb7131884cad5c66d411305aa8
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
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 */
11 #ifndef PATHINFO_H
12 #define PATHINFO_H
14 #include "export.h"
16 class TAGUA_EXPORT PathInfo {
17 public:
18 enum Direction {
19 Undefined,
20 Horizontal,
21 Vertical,
22 Diagonal1,
23 Diagonal2
25 private:
26 Direction m_direction;
27 int m_num_obstacles;
28 public:
30 PathInfo(Direction direction, int num_obstacles);
32 Direction direction() const { return m_direction; }
33 bool parallel() const { return m_direction == Horizontal || m_direction == Vertical; }
34 bool diagonal() const { return m_direction == Diagonal1 || m_direction == Diagonal2; }
35 bool clear() const { return m_num_obstacles == 0; }
36 int numObstacles() const { return m_num_obstacles; }
37 bool valid() const { return m_direction != Undefined; }
40 #endif // PATHINFO_H