Dawn/src/dawnpokergame/ui/PokerPlayerDisplay.hpp
2022-12-04 15:36:40 -08:00

42 lines
1002 B
C++

// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "ui/UILabel.hpp"
#include "ui/UIEmpty.hpp"
#include "poker/PokerPlayer.hpp"
#include "asset/AssetManager.hpp"
#include "asset/assets/TrueTypeAsset.hpp"
#include "display/animation/Animation.hpp"
namespace Dawn {
class PokerPlayerDisplay : public UIEmpty {
private:
Animation<int32_t> animChips;
int32_t animChipsValue;
protected:
PokerPlayer *player = nullptr;
UILabel labelName;
UILabel labelChips;
TrueTypeAsset *font;
void onPlayerChipsChanged();
void onSceneUpdate();
public:
static std::vector<Asset*> getAssets(AssetManager *assMan) {
return std::vector<Asset*>{
assMan->get<TrueTypeAsset>("truetype_ark")
};
}
PokerPlayerDisplay(UICanvas *canvas);
void setPlayer(PokerPlayer *player);
~PokerPlayerDisplay();
};
}