File indexing completed on 2024-04-21 04:03:16

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 HITINFO_H
0008 #define HITINFO_H
0009 
0010 #include "coord.h"
0011 
0012 class Ship;
0013 
0014 struct HitInfo
0015 {
0016     enum Type
0017     {
0018         HIT,
0019         MISS,
0020         INVALID
0021     };
0022     
0023     Type type;
0024     Ship* shipDestroyed;
0025     Coord shipPos;
0026     
0027     HitInfo(Type type)
0028     : type(type)
0029     , shipDestroyed(nullptr)
0030     {
0031     }
0032     
0033     HitInfo(Type type, Ship* shipDestroyed, const Coord& shipPos)
0034     : type(type)
0035     , shipDestroyed(shipDestroyed)
0036     , shipPos(shipPos)
0037     {
0038     }
0039 };
0040 
0041     
0042 #endif // HITINFO_H
0043