Skip to content

na1x/DeCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The "DeCore" is a Russian card game engine.

Developed with c++ the engine is aimed to be cross-platform and portable (where c++ is available).
Please refer to wiki documentation for further details.


Requirements:
    decore lib:
        - pthreads
    tests:
        - pthreads
        - cppunit

Building library:
	cd decore && qmake decore.pro && make

Building tests (is not required for the users though):
	cd tests && qmake tests.pro && make

Or to build library and tests at once:
	qmake all.pro && make

Building doxygen documentation:
	doxygen doxygen.cfg


Sample usage of the library:

	YourPlayerImplementation player0, player1;
	YourObserverImplementation observer;

	Engine engine;

	// add players
	engine.add(player0);
	engine.add(player1);

	// add optional observer
	engine.addGameObserver(observer);

	// prepare deck
	Deck deck;

	Rank ranks[] = {
	    RANK_6,
	    RANK_7,
	    RANK_8,
	    RANK_9,
	    RANK_10,
	    RANK_JACK,
	    RANK_QUEEN,
	    RANK_KING,
	    RANK_ACE,
	};

	Suit suits[] = {
	    SUIT_SPADES,
	    SUIT_HEARTS,
	    SUIT_DIAMONDS,
	    SUIT_CLUBS,
	};

	deck.generate(ranks, sizeof(ranks) / sizeof(ranks[0]), suits, sizeof(suits) / sizeof(suits[0]));
	deck.shuffle();

	// set deck
	engine.setDeck(deck);

	// play game
	while(engine.playRound());

	// get loser
	// loser is NULL in case of draw
	const PlayerId* loser = engine.getLoser();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published