SVN_SILENT made messages (.desktop file)
[kdegames.git] / kbattleship / src / playerentity.h
blobaae134ec0973ff6f70a4067147c069108c59259a
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 */
10 #ifndef PLAYERENTITY_H
11 #define PLAYERENTITY_H
13 #include <QList>
14 #include "sea.h"
15 #include "uientity.h"
16 #include "delegate.h"
17 #include "stats.h"
19 class ChatWidget;
21 class PlayerEntity : public UIEntity, private Delegate
23 Q_OBJECT
24 QList<Ship*> m_ships;
26 Ship* nextShip();
27 Ship* canAddShip(const Coord& c);
29 ChatWidget* m_chat;
30 public:
31 PlayerEntity(Sea::Player player, Sea* sea, SeaView* view, ChatWidget* chat);
33 // entity interface
34 virtual void start(bool);
35 virtual void hit(Shot* shot);
36 virtual void notify(Sea::Player player, const Coord& c, const HitInfo& info);
37 virtual void notifyChat(const Entity* entity, const QString& text);
38 virtual void notifyNick(Sea::Player player, const QString& text);
40 // delegate interface
41 virtual void action(Sea::Player player, const Coord& c);
42 virtual void changeDirection(Sea::Player player);
43 virtual Ship* canAddShip(Sea::Player player, const Coord& c);
45 virtual void setNick(const QString& nick);
46 protected:
47 // parent interface
48 virtual void registerHit(Sea::Player player, const Coord& c);
49 virtual void registerMiss(Sea::Player player, const Coord& c);
50 public slots:
51 virtual void notifyAbort();
54 #endif // PLAYERENTITY_H