Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d64b85c
chore: add header skeletons and pragma once
fawwazazam Apr 13, 2026
c536e1b
feat(models): add Enums.hpp
fawwazazam Apr 13, 2026
b749723
fix(models): add missing PropertyType enum
fawwazazam Apr 13, 2026
bf4fbe3
feat : add config and state .hpp
ucupsss Apr 14, 2026
45f9400
Merge pull request #1 from Labpro-22/configstate
ucupsss Apr 14, 2026
f20b7b4
feat : add cards (ActionCard and SkillCard) header
Akram17t Apr 14, 2026
41d8e0c
feat(models,views): add player and view class headers
fawwazazam Apr 14, 2026
246aedb
Merge pull request #2 from Labpro-22/feat/player-views-hpp
fawwazazam Apr 14, 2026
c9cf76a
feat: add coreheader
NathanaelGun Apr 14, 2026
01e8e21
feat: added tile.hpp
hafizhperdana Apr 15, 2026
fa2330d
Merge pull request #3 from Labpro-22/feat/cards
fawwazazam Apr 15, 2026
a60ac6e
Merge pull request #4 from Labpro-22/feat/core-utils
fawwazazam Apr 15, 2026
9f831c1
feat: add utils hpp including exceptions hpp
NathanaelGun Apr 15, 2026
f24bb27
Merge pull request #5 from Labpro-22/feat/core-utils
fawwazazam Apr 15, 2026
1f9f713
feat: add header declaration
hafizhperdana Apr 15, 2026
90a22a8
fix: const correction
hafizhperdana Apr 15, 2026
4aa5a34
Merge pull request #6 from Labpro-22/feat/tiles
fawwazazam Apr 15, 2026
738737d
chore: clean up header interfaces
fawwazazam Apr 15, 2026
f637e6b
Merge pull request #7 from Labpro-22/feat/player-views-hpp
fawwazazam Apr 15, 2026
f658231
chore: set up bootstrap flow and add implementation scaffolds
fawwazazam Apr 15, 2026
5e4e24d
Merge pull request #8 from Labpro-22/feat/bootstrap-app
fawwazazam Apr 15, 2026
0a1110c
feat: implement GameState and TransactionLogger
Akram17t Apr 16, 2026
ab2600d
feat(core): add Dice.cpp implementation
fawwazazam Apr 16, 2026
315e93c
feat : add implement config
ucupsss Apr 16, 2026
33019ed
Merge pull request #9 from Labpro-22/feat/config-cpp
ucupsss Apr 16, 2026
cf54b5b
feat(core): add TurnManager.cpp and AuctionManager.cpp implementation
fawwazazam Apr 16, 2026
cfbdd39
feat(core): add GameContext.cpp implementation
fawwazazam Apr 16, 2026
88aa513
Merge pull request #10 from Labpro-22/feat/gamecontext
fawwazazam Apr 16, 2026
e3f1636
chore: readjust makefile
fawwazazam Apr 16, 2026
48bb5e2
Merge pull request #11 from Labpro-22/feat/utils
fawwazazam Apr 16, 2026
c9428d1
merge feat/bootstrap-app into integrate
fawwazazam Apr 16, 2026
d2df0e6
feat: added PlayerState and PropertyState implementation
hafizhperdana Apr 17, 2026
845ac3a
Merge pull request #12 from Labpro-22/feat/tiles
hafizhperdana Apr 17, 2026
eb77485
feat: add implementation of configloader.cpp
NathanaelGun Apr 17, 2026
d95687c
feat: add config from specification for testing
NathanaelGun Apr 17, 2026
fff3b38
Merge pull request #13 from Labpro-22/feat/configloader-cpp
NathanaelGun Apr 17, 2026
ca7e88c
feat: implement SaveManager
Akram17t Apr 17, 2026
1cd2425
Merge pull request #16 from Labpro-22/feat/utils
Akram17t Apr 17, 2026
3697d5e
refactor(headers): align class interfaces with game specification)
fawwazazam Apr 18, 2026
548b436
refactor(ui-startup): align main menu flow with spec-based load command
fawwazazam Apr 18, 2026
dde4c02
feat(state): add Command.cpp implementation
fawwazazam Apr 19, 2026
cb4baf1
feat: implement bankruptcy handling and board
Akram17t Apr 20, 2026
7453070
feat(core): add GameEngine.cpp implementation (WIP: it's not fully im…
fawwazazam Apr 20, 2026
2042c48
feat: added implementation for tile and its dependencies
hafizhperdana Apr 21, 2026
e09536a
feat(models): add Player.cpp implementation)
fawwazazam Apr 21, 2026
28ba262
Merge pull request #17 from Labpro-22/feat/player
fawwazazam Apr 21, 2026
734142a
feat: add implementation for action tile
NathanaelGun Apr 21, 2026
54c46e5
fix: add changes to accomodate changes for action tile implementation
NathanaelGun Apr 21, 2026
24fbcae
Merge pull request #18 from Labpro-22/feat/action-tile
NathanaelGun Apr 21, 2026
41c836e
Merge branch 'integrate' into feat/utils
Akram17t Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/misc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MAX_TURN SALDO_AWAL
15 1000
29 changes: 29 additions & 0 deletions config/property.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ID KODE NAMA JENIS WARNA HARGA_LAHAN NILAI_GADAI UPG_RUMAH UPG_HT RENT_L0 RENT_L1 RENT_L2 RENT_L3 RENT_L4 RENT_L5
2 GRT GARUT STREET COKLAT 60 40 20 50 2 10 30 90 160 250
4 TSK TASIKMALAYA STREET COKLAT 60 40 50 50 4 20 60 180 240 320
6 GBR STASIUN_GAMBIR RAILROAD DEFAULT 0 20
7 BGR BOGOR STREET BIRU_MUDA 100 80 20 50 6 30 90 270 340 400
9 DPK DEPOK STREET BIRU_MUDA 100 80 20 50 6 30 90 270 340 400
10 BKS BEKASI STREET BIRU_MUDA 120 90 20 50 8 40 100 300 380 450
12 MGL MAGELANG STREET MERAH_MUDA 140 100 100 100 10 50 150 450 600 750
13 PLN PLN UTILITY ABU_ABU 0 25
14 SOL SOLO STREET MERAH_MUDA 140 100 100 100 10 50 150 450 600 750
15 YOG YOGYAKARTA STREET MERAH_MUDA 160 120 100 100 12 60 180 500 700 900
16 STB STASIUN_BANDUNG RAILROAD DEFAULT 0 40
17 MAL MALANG STREET ORANGE 180 135 100 100 14 70 200 550 750 950
19 SMG SEMARANG STREET ORANGE 180 140 100 100 14 70 200 550 750 950
20 SBY SURABAYA STREET ORANGE 200 150 100 100 16 80 220 600 800 1000
22 MKS MAKASSAR STREET MERAH 220 175 150 150 18 90 250 700 850 1050
24 BLP BALIKPAPAN STREET MERAH 220 175 150 150 18 90 250 700 850 1050
25 MND MANADO STREET MERAH 240 190 150 150 20 100 300 750 900 1100
26 TUG STASIUN_TUGU RAILROAD DEFAULT 0 50
27 PLB PALEMBANG STREET KUNING 260 200 150 150 22 110 330 800 950 1150
28 PKB PEKANBARU STREET KUNING 260 210 150 150 22 110 330 800 950 1150
29 PAM PAM UTILITY ABU_ABU 0 60
30 MED MEDAN STREET KUNING 280 225 150 150 24 120 360 850 1000 1200
32 BDG BANDUNG STREET HIJAU 300 250 200 200 26 130 390 900 1100 1275
33 DEN DENPASAR STREET HIJAU 300 260 200 200 26 130 390 900 1100 1275
35 MTR MATARAM STREET HIJAU 320 280 200 200 28 150 450 1000 1200 1400
36 GUB STASIUN_GUBENG RAILROAD DEFAULT 0 120
38 JKT JAKARTA STREET BIRU_TUA 350 300 200 200 35 175 500 1100 1300 1500
40 IKN IBU_KOTA_NUSANTARA STREET BIRU_TUA 400 350 200 200 50 200 600 1400 1700 2000
5 changes: 5 additions & 0 deletions config/railroad.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
JUMLAH_RAILROAD BIAYA_SEWA
1 25
2 50
3 100
4 200
2 changes: 2 additions & 0 deletions config/special.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GO_SALARY JAIL_FINE
200 50
2 changes: 2 additions & 0 deletions config/tax.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PPH_FLAT PPH_PERSENTASE PBM_FLAT
150 10 200
3 changes: 3 additions & 0 deletions config/utility.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
JUMLAH_UTILITY FAKTOR_PENGALI
1 4
2 10
29 changes: 29 additions & 0 deletions include/core/AuctionManager.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#pragma once

#include <vector>

class PropertyTile;
class Player;

class AuctionManager {
private:
PropertyTile* property;
int highestBid;
Player* highestBidder;
int consecutivePasses;

public:
AuctionManager();

void conductAuction(PropertyTile* property, const std::vector<Player*>& players, Player* startingPlayer);
bool processBid(Player* player, int amount);
void processPass(Player* player);
bool isFinished(int totalActivePlayers) const;
void finalizeAuction();

void reset();

PropertyTile* getProperty() const;
int getHighestBid() const;
Player* getHighestBidder() const;
};
18 changes: 18 additions & 0 deletions include/core/BankruptcyHandler.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

class Player;
class Board;
class AuctionManager;
class GameContext;

class BankruptcyHandler {
public:
BankruptcyHandler() = default;

void handleBankruptcy(Player& player, Player* creditor, int amount, GameContext& context);
int calculateLiquidationMax(Player& player) const;
void showLiquidationPanel(Player& player, int needed, GameContext& context);
void transferAssetsToPlayer(Player& from, Player& to);
void transferAssetsToBank(Player& player, Board& board, AuctionManager& auction);
void declareBankrupt(Player& player, GameContext& context);
};
37 changes: 37 additions & 0 deletions include/core/Board.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once

#include <vector>
#include <map>
#include <string>

class Tile;
class PropertyTile;
class RailroadTile;
class StreetTile;
class Player;
enum class ColorGroup;

class Board {
private:
std::vector<Tile*> tiles;
std::map<std::string, PropertyTile*> propertyIndex;

public:
Board();
~Board();

void buildBoard(const std::vector<Tile*>& boardTiles);
Tile* getTile(int index) const;
Tile* getTile(const std::string& code) const;

std::vector<PropertyTile*> getProperties() const;
std::vector<StreetTile*> getProperties(ColorGroup colorGroup) const;

RailroadTile* getNearestRailroad(int fromIndex) const;
int getTileCount() const;
void tickFestivals(Player& player);

bool hasMonopoly(const Player& player, ColorGroup colorGroup) const;
int getRailroadCount(const Player& player) const;
int getUtilityCount(const Player& player) const;
};
19 changes: 19 additions & 0 deletions include/core/Dice.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <random>

class Dice {
private:
int die1;
int die2;
std::mt19937 rng;

public:
Dice();
void roll();
void setManual(int d1, int d2);
int getDie1() const;
int getDie2() const;
int getTotal() const;
bool isDouble() const;
};
57 changes: 57 additions & 0 deletions include/core/GameContext.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#include <string>
#include "models/Player.hpp"

class Board;
class TurnManager;
class AuctionManager;
class TransactionLogger;
class Dice;
class ActionCard;
class SkillCard;
class BankruptcyHandler;
template <typename T> class CardDeck;

class GameContext {
private:
Board* board;
TurnManager* turnManager;
AuctionManager* auctionManager;
BankruptcyHandler* bankruptcyHandler;
TransactionLogger* logger;
Dice* dice;
CardDeck<ActionCard>* chanceDeck;
CardDeck<ActionCard>* communityDeck;
CardDeck<SkillCard>* skillDeck;

public:
GameContext(
Board* board,
TurnManager* turnManager,
AuctionManager* auctionManager,
BankruptcyHandler* bankruptcyHandler,
TransactionLogger* logger,
Dice* dice,
CardDeck<ActionCard>* chanceDeck,
CardDeck<ActionCard>* communityDeck,
CardDeck<SkillCard>* skillDeck
);

Board* getBoard() const;
TurnManager* getTurnManager() const;
AuctionManager* getAuctionManager() const;
BankruptcyHandler* getBankruptcyHandler() const;
TransactionLogger* getLogger() const;
Dice* getDice() const;
CardDeck<ActionCard>* getChanceDeck() const;
CardDeck<ActionCard>* getCommunityDeck() const;
CardDeck<SkillCard>* getSkillDeck() const;

void triggerStreetEvent(Player& player, PropertyTile& tile);
void triggerRentEvent(Player& player, PropertyTile& tile);
bool hasMonopoly(const Player& player, ColorGroup colorGroup) const;
int getRailroadCount(const Player& player) const;
int getUtilityCount(const Player& player) const;
void logEvent(const std::string& actionType, const std::string& detail);
};
63 changes: 63 additions & 0 deletions include/core/GameEngine.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#pragma once

#include <vector>
#include <string>

#include "models/Player.hpp"
#include "Board.hpp"
#include "Dice.hpp"
#include "TurnManager.hpp"
#include "AuctionManager.hpp"
#include "BankruptcyHandler.hpp"
#include "utils/CardDeck.hpp"

class ActionCard;
class SkillCard;
class ConfigData;
class GameState;
class Command;
class TransactionLogger;
class GameContext;

class GameEngine {
private:
std::vector<Player> players;
Board board;
Dice dice;
TurnManager turnManager;
AuctionManager auctionManager;
BankruptcyHandler bankruptcyHandler;
TransactionLogger* logger;

CardDeck<ActionCard> chanceDeck;
CardDeck<ActionCard> communityDeck;
CardDeck<SkillCard> skillDeck;

GameContext* context;
const ConfigData* configData;

void buildBoard();
void buildDecks();
void randomizeTurnOrder();

public:
GameEngine(TransactionLogger* logger);
~GameEngine();

void initialize(const ConfigData& configData, const std::vector<std::string>& playerNames);

void startNewGame();

void loadGame(const GameState& gameState);

void runGameLoop();

void processTurn(Player& player);
void processCommand(const Command& cmd, Player& player);

bool checkGameEnd() const;

std::vector<Player*> determineWinner() const;

void distributeSkillCards();
};
33 changes: 33 additions & 0 deletions include/core/TurnManager.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#pragma once

#include <vector>
#include <string>

class Player;

class TurnManager {
private:
std::vector<Player*> turnOrder;
int currentIndex;
int currentTurn;
int maxTurn;

public:
TurnManager(int maxTurn);
void initializeTurnOrder(const std::vector<Player*>& players);
void restoreTurnOrder(const std::vector<std::string>& orderedUsernames, const std::vector<Player*>& allPlayers);
Player* getCurrentPlayer() const;
void advance();
bool isMaxTurnReached() const;
void removePlayer(Player* player);
std::vector<Player*> getActivePlayers() const;
Player* getPlayerAfter(Player* player) const;

int getCurrentTurn() const;
int getMaxTurn() const;
void setCurrentTurn(int turn);
void setCurrentIndex(int index);

void handlePropertyLanded(Player& player, PropertyTile& tile, GameContext& context);
void handleRentPayment(Player& player, PropertyTile& tile, GameContext& context);
};
49 changes: 49 additions & 0 deletions include/models/Enums.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#pragma once

enum class TileCategory {
PROPERTY,
ACTION,
SPECIAL,
DEFAULT
};

enum class PropertyType {
STREET,
RAILROAD,
UTILITY
};

enum class ColorGroup {
COKLAT,
BIRU_MUDA,
MERAH_MUDA,
ORANGE,
MERAH,
KUNING,
HIJAU,
BIRU_TUA,
ABU_ABU,
DEFAULT
};

enum class PlayerStatus {
ACTIVE,
JAILED,
BANKRUPT
};

enum class PropertyStatus {
BANK,
OWNED,
MORTGAGED
};

enum class TaxType {
PPH,
PBM
};

enum class CardType {
CHANCE,
COMMUNITY_CHEST
};
Loading