Commit eec58203 authored by Jostein Bratlie's avatar Jostein Bratlie

Minor compile fixes

* added missing header file
* covered missing possible branch in gameengin convertPlayerId utility
* removed stray namespace and enumeration duplicates
* added MSVC compile flag to suppress internal Qt compile error
parent 8996bda9
......@@ -11,6 +11,7 @@
#include <memory>
#include <chrono>
#include <string>
#include <optional>
namespace gameengine
......
......@@ -20,7 +20,9 @@ target_compile_options(${PROJECT_NAME}
-Wno-redundant-parens
>
PUBLIC $<$<CXX_COMPILER_ID:GNU>: ${GCC_COMPILE_OPTIONS}>
PUBLIC $<$<CXX_COMPILER_ID:MSVC>: ${MSVC_COMPILE_OPTIONS}>
PUBLIC $<$<CXX_COMPILER_ID:MSVC>: ${MSVC_COMPILE_OPTIONS}
/wd4127 # QT: Conditional expression is constant
>
)
# Turn off platform-spesific extensions
......
......@@ -82,11 +82,11 @@ GameModel::PlayerId GameModel::convertPlayerId(gameengine::PlayerIdOpt gm_id)
if (not gm_id) return PlayerId::NoPlayer;
switch (*gm_id) {
case gameengine::PlayerId::One:
return PlayerId::PlayerOne;
case gameengine::PlayerId::Two:
return PlayerId::PlayerTwo;
case gameengine::PlayerId::One: return PlayerId::PlayerOne;
case gameengine::PlayerId::Two: return PlayerId::PlayerTwo;
default: return PlayerId::NoPlayer;
}
}
void GameModel::registerAsQmlType()
......
......@@ -14,16 +14,6 @@
#include <memory>
namespace gamemodel {
Q_NAMESPACE
using PlayerId = gameengine::PlayerId;
using PlayerType = gameengine::PlayerType;
Q_ENUM_NS(PlayerId)
Q_ENUM_NS(PlayerType)
};
class GameModel : public QAbstractListModel {
Q_OBJECT
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment