Files
Leviathan/Client/Game/game/Interface/Arena/ArenaBingoBoard.h
T
2026-06-01 12:46:52 +02:00

224 lines
6.1 KiB
C++

#ifndef _ArenaBingoBoard_h_
#define _ArenaBingoBoard_h_
//#include "Util.h"
//#include "SUIUtil.h"
class SUIWnd;
class KUIWnd;
#pragma pack(push, 1)
struct sBingo;
struct sBingoControlTable;
struct sBingoBoard;
/*
*/
struct sBingoMan
{
public:
void reset();
void procEffect(float offset, bool& end);
void getWndInfo(SUIWnd* parent, int bingoManIndex);
void setStatus(int bingoManStatus);
bool isBingo() const { return m_isBingo; }
int getStatus() const { return m_status; }
void setBingo(bool isBingo) { m_isBingo = isBingo; }
private:
void readyEffect();
char const* getTeamAniName(int team) const;
void changeAlpha(float offset, bool& end);
void endProcEffect();
private:
KUIWnd* m_wndCur; /// 현재 빙고 프랍
KUIWnd* m_wndNew; /// 새로운 빙고 프랍
int m_status; /// 점령 상태
bool m_isBingo;
};
/*
*/
struct sBingoManTable
{
enum { MAX_BINGOMAN_NUM = 9 }; /// 최대 말 수
void getWndInfo(SUIWnd* parent);
void reset();
void reset(int bingoManIndex);
void setStatus(int bingoManStatus, int bingoManIndex);
int getStatus(int bingoManIndex) const;
bool isValidIndex(int bingoManIndex) const;
/// bingoManIndex 빙고 말이 빙고된 상태인지 아닌지
bool isBingo(int bingoManIndex) const;
bool checkBingo(sBingo const* bingo, int& bingoManStatus) const;
void setBingo(sBingo const* bingo, bool isBingo);
void procEffect(int bingoManIndex, float offset, bool& end);
private:
/* 말 인덱스
0 1 2
3 4 5
6 7 8
*/
sBingoMan m_bingoMan[MAX_BINGOMAN_NUM];
};
/*
*/
struct sBingo
{
public:
/// 빙고가 될 수 있는 최대 말 개수 (sBingoManTable::MAX_BINGOMAN_NUM과 헷깔리지 말자)
enum { MAX_BINGOMAN_NUM = 3 };
/// 빙고가 될 수 있는 최대 라인 수
enum { MAX_BINGOLINE_NUM = 8 };
/// 이펙트 컨트롤 타입
enum { EFFECT_BINGOMAN,
EFFECT_BINGOMAN_1X,
EFFECT_BINGOMAN_2X, /// bingoman
EFFECT_BAR,
EFFECT_BAR_1X,
EFFECT_BAR_2X, /// bar
MAX_EFFECT_TYPE_NUM
};
sBingo(int bingoIndex);
~sBingo() ;
void setIndex(int i0, int i1, int i2);
/// effectType : EFFECT_NORMAL/EFFECT_OVER
void addControlIndex(bool isBingoMan, int controlNum, ...);
void reset();
void setBingoEffectAniName(int bingoManStatus);
void setEffectShow(int effectType, bool show, float alpha);
void incEffectAlpha(int effectType, float offset, bool& end);
void decEffectAlpha(int effectType, float offset, bool& end);
int getBingoManIndex(int index) const { return m_manIndex[index]; } /// index : 0 or 1 or 2
void setBingoControlTable(sBingoControlTable const* bingoControlTable) { m_bingoControlTable = bingoControlTable; }
int getBingoIndex() const { return m_bingoIndex; }
private:
void setEffectAlpha(int effectType, float alpha);
KUIWnd* getControl(int effectType, int index) const;
float getFirstEffectControlAlpha(int effectType) const;
void setBingoAniName(int effectType, int bingoManStatus);
private:
int m_bingoIndex;
int m_manIndex[MAX_BINGOMAN_NUM];
/// 이펙트 컨트롤 리스트 인덱스, sBingoControlTable에서 참조
std::vector<int> m_effectControlList[MAX_EFFECT_TYPE_NUM];
sBingoControlTable const* m_bingoControlTable;
};
/*
*/
struct sBingoEffectState
{
enum { STATE_INC_1X, STATE_INC_2X, STATE_DEC_2X, STATE_DEC_1X, STATE_DEC_BINGOMAN, STATE_END };
void init(sBingo* bingo, int bingoManStatus);
void process(float elapsedTime);
void procInc1X(float elapsedTime, float offsetAlpha);
void procInc2X(float elapsedTime, float offsetAlpha);
void procDec2X(float elapsedTime, float offsetAlpha);
void procDec1X(float elapsedTime, float offsetAlpha);
void procDecBingoMan(float elapsedTime, float offsetAlpha);
void setState(int state);
bool isEnd() const { return m_state == STATE_END; }
int m_state;
int m_bingoManStatus;
sBingo* m_bingo;
static float ALPHA_V;
};
/* 빙고가 ‰瑛?때의 연출
*/
struct sBingoEffect
{
public:
~sBingoEffect();
void add(sBingo* bingo, int bingoManStatus);
bool is(int bingoIndex) const;
void process(float elapsedTime, sBingoManTable* bingoManTable, sBingoBoard* bingoBoard);
private:
void resetBingoMan(sBingoManTable* bingoManTable, sBingo* bingo);
void addUpdateBingoManList(sBingoManTable* bingoManTable, sBingo* bingo);
/// m_updateBingoManList의 리스트를 최종 상태로 업데이트 해준다
void updateBingoManStatus(sBingoBoard* bingoBoard);
private:
std::list<sBingoEffectState> m_list;
/// 빙고 연출이 끝났을 때, sBingoBoard에서 빙고 말의 상태를 업데이트 해줘야 되기 때문에 필요한 리스트를 저장해 놓는다
std::list<int> m_updateBingoManList;
};
/* /// 빙고 말이 점령 ‰瑛?때의 연출
*/
struct sBingoManOccupationEffect
{
public:
~sBingoManOccupationEffect();
void process(float elapsedTime, sBingoManTable* bingoManTable, bool& existEndBingoMan);
void add(int bingoManIndex);
private:
bool is(int bingoManIndex) const;
void processBingoMan(float elapsedTime, sBingoManTable* bingoManTable, int bingoManIndex, bool& end);
private:
std::map<int, int> m_list; /// 연출중인 리스트들
static float ALPHA_V;
};
/// 빙고판의 컨트롤들의 테이블
struct sBingoControlTable
{
~sBingoControlTable();
void addEffectWnd(SUIWnd* parent, int effectType, char const* prefixId, int controlNum);
KUIWnd* getControl(int effectType, int index) const;
std::vector<KUIWnd*> m_list[sBingo::MAX_EFFECT_TYPE_NUM];
};
/*
*/
struct sBingoBoard
{
public:
sBingoBoard();
~sBingoBoard();
void initialize(SUIWnd* parent);
void reset();
void process(float elapsedTime, int& bingoCount);
void setStatus(int bingoManStatus, int bingoManIndex);
private:
void initBingoList(SUIWnd* parent);
void initBingoControlTable(SUIWnd* parent);
void checkBingo(int& bingoCount);
void addBingoEffect(int bingoIndex, int bingoManStatus);
public:
/*
bingo index
0 : (0, 1, 2)
1 : (3, 4, 5)
2 : (6, 7, 8)
3 : (0, 3, 6)
4 : (1, 4, 7)
5 : (2, 5, 8)
6 : (0, 4, 8)
7 : (2, 4, 6)
*/
std::vector<sBingo*> m_bingoList;
sBingoManTable* m_bingoManTable;
sBingoEffect m_bingoEffect;
sBingoManOccupationEffect m_bingoManOccupationEffect;
sBingoControlTable m_bingoControlTable;
private:
};
#pragma pack(pop)
#endif