I already have cards and a deck and a working engine, all I need is an input/output interface that isn't poopy like the console.
Code:
class Card_Game
{
public:
Card_Game(){}
~Card_Game(){}
virtual void init(){}
virtual void cleanup(){}
virtual void turn_logic(std::string player_id);
std::vector<std::string> m_vPlayer_List;
int get_setting(std::string name);
protected:
int calculate_winnings();
void new_setting(std::string name, Setting * new_setting);
void initialize_players();
// Give player id a new hand
void give_player_hand(std::string player_id);
void shuffle_deck(int deck_id);
// Draw how_many cards to player id's hand_id from deck_idntyd
void draw_card(std::string player_id, int hand_id, int deck_id, int how_many);
void place_bet(std::string player_id, int bet);
// Split player's active hand
void split_hand(std::string player_id, int hand_id);
// check if hand value > check_value
bool check_hand_value(std::string player_id, int hand_id, int check_value);
Resource_Manager< Player > m_rPlayers;
Resource_Manager< std::vector<Hand*> > m_rHands;
Resource_Manager< int* > m_rBets;
Resource_Manager< Deck* > m_rDecks;
Resource_Manager< Setting > m_rSettings;
std::vector< Deck* > m_vDeck;
};
The idea I'm trying to grasp right now is how to work windows into my state manager. This is how I update my game logic:
Code:
srand ( unsigned(time(NULL)) );
Blackjack_Game * game = new Blackjack_Game();
game->init();
State_Manager * state_manager = new State_Manager;
state_manager->change_state(new Play_State(state_manager, game) );
*/
/*
while ( state_manager->running() )
{
state_manager->update();
state_manager->print();
state_manager->handle_events();
}
game->cleanup();
I want to integrate the windows messaging system into my state manager.
They will be responsible for the creation of certain windows and buttons and such, and also accept messages from Win32 and handle them, like a WM_COMMAND I suppose.