File indexing completed on 2024-07-14 04:00:56

0001 /*
0002     SPDX-FileCopyrightText: 2007 Paolo Capriotti <p.capriotti@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef UIENTITY_H
0008 #define UIENTITY_H
0009 
0010 #include "entity.h"
0011 
0012 class SeaView;
0013 
0014 class UIEntity : public Entity
0015 {
0016 Q_OBJECT
0017 protected:
0018     Sea* m_sea;
0019 
0020     void drawShoot(Sea::Player player, const Coord& c, const HitInfo& info);
0021     void drawHiddenShips(Sea::Player winner);
0022 public:
0023     UIEntity(Sea::Player player, Sea*, SeaView* view);
0024     ~UIEntity() override;
0025     
0026     void notify(Sea::Player player, const Coord& c, const HitInfo& info) override;
0027     void notifyGameOver(Sea::Player winner) override;
0028     void notifyChat(const Entity*, const QString&) override { }
0029     void notifyNick(Sea::Player, const QString&) override { }
0030     void notifyGameOptions() override { Q_EMIT gameOptionsInterchanged(); }
0031     void start() override;
0032     void startPlacing() override { };
0033     void hit(Shot*) override;
0034     
0035     virtual void registerHit(Sea::Player, const Coord&) { }
0036     virtual void registerMiss(Sea::Player, const Coord&) { }
0037     
0038     QIcon icon() const override;
0039 public Q_SLOTS:
0040     void notifyAbort() override { }
0041     void notifyRestartPlacing(Sea::Player) override { };
0042 };
0043 
0044 #endif // UIENTITY_H