소스 검색

Added Poker README and separated out Enums into their own files.

Dominique Louis 1 개월 전
부모
커밋
4bd3aeabb0

+ 0 - 12
CardsStarterKit/Core/Game/Blackjack/Game/BlackjackCardGame.cs

@@ -18,18 +18,6 @@ using System.Reflection;
 
 namespace Blackjack
 {
-    /// <summary>
-    /// The various possible game states.
-    /// </summary>
-    public enum BlackjackGameState
-    {
-        Shuffling,
-        Betting,
-        Playing,
-        Dealing,
-        RoundEnd,
-        GameOver,
-    }
 
     class BlackjackCardGame : CardsGame
     {

+ 22 - 0
CardsStarterKit/Core/Game/Blackjack/Game/BlackjackGameState.cs

@@ -0,0 +1,22 @@
+//-----------------------------------------------------------------------------
+// BlackjackGame.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+namespace Blackjack
+{
+    /// <summary>
+    /// The various possible game states.
+    /// </summary>
+    public enum BlackjackGameState
+    {
+        Shuffling,
+        Betting,
+        Playing,
+        Dealing,
+        RoundEnd,
+        GameOver,
+    }
+}

+ 0 - 12
CardsStarterKit/Core/Game/Blackjack/Players/BlackjackPlayer.cs

@@ -10,20 +10,8 @@ using System.Collections.Generic;
 using System.Text;
 using CardsFramework;
 
-
-
-
 namespace Blackjack
 {
-    /// <summary>
-    /// Depicts hands the player can interact with.
-    /// </summary>
-    public enum HandTypes
-    {
-        First,
-        Second
-    }
-
     public class BlackjackPlayer : Player
     {
         // Various fields which depict the state of the players two hands

+ 18 - 0
CardsStarterKit/Core/Game/Blackjack/Players/HandTypes.cs

@@ -0,0 +1,18 @@
+//-----------------------------------------------------------------------------
+// HandTypes.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+namespace Blackjack
+{
+    /// <summary>
+    /// Depicts hands the player can interact with.
+    /// </summary>
+    public enum HandTypes
+    {
+        First,
+        Second
+    }
+}}

+ 1 - 4
CardsStarterKit/Core/Game/Blackjack/Rules/BlackjackGameEventArgs.cs

@@ -8,9 +8,6 @@
 using System;
 using CardsFramework;
 
-
-
-
 namespace Blackjack
 {
     public class BlackjackGameEventArgs : EventArgs
@@ -18,4 +15,4 @@ namespace Blackjack
         public Player Player { get; set; }
         public HandTypes Hand { get; set; }
     }
-}
+}

+ 0 - 3
CardsStarterKit/Core/Game/Blackjack/Rules/BlackjackRule.cs

@@ -10,9 +10,6 @@ using System.Collections.Generic;
 using System.Text;
 using CardsFramework;
 
-
-
-
 namespace Blackjack
 {
     /// <summary>

+ 0 - 3
CardsStarterKit/Core/Game/Blackjack/Rules/BustRule.cs

@@ -10,9 +10,6 @@ using System.Collections.Generic;
 using System.Text;
 using CardsFramework;
 
-
-
-
 namespace Blackjack
 {   
     /// <summary>

+ 0 - 3
CardsStarterKit/Core/Game/Blackjack/Rules/InsuranceRule.cs

@@ -10,9 +10,6 @@ using System.Collections.Generic;
 using System.Text;
 using CardsFramework;
 
-
-
-
 namespace Blackjack
 {
     /// <summary>

+ 0 - 3
CardsStarterKit/Core/Game/Blackjack/UI/BlackjackAnimatedDealerHandComponent.cs

@@ -11,9 +11,6 @@ using System.Text;
 using CardsFramework;
 using Microsoft.Xna.Framework;
 
-
-
-
 namespace Blackjack
 {
     public class BlackjackAnimatedDealerHandComponent : AnimatedHandGameComponent

+ 81 - 0
CardsStarterKit/Core/Game/Poker/README.md

@@ -0,0 +1,81 @@
+# Poker Game Implementation Guide
+
+This guide will help you implement a Texas Hold 'Em Poker game using the Cards Framework provided in this repository. It is intended for new developers who want to extend the existing codebase with a new card game, leveraging the modular, event-driven, and component-based architecture already in place.
+
+## Directory Structure
+
+- `Game/` — Core Poker game logic (game state, table, dealing, betting rounds)
+- `Players/` — Player classes (human, AI, seat management)
+- `Rules/` — Poker-specific rules (hand evaluation, betting logic, round progression)
+- `UI/` — User interface components (screens, menus, in-game UI)
+- `Misc/` — Utilities, helpers, and shared resources
+
+## Getting Started
+
+1. **Familiarize Yourself with the Cards Framework**
+   - Review `Framework/Cards/TraditionalCard.cs`, `Framework/Cards/Hand.cs`, and `Framework/Game/CardsGame.cs`.
+   - Understand how the framework models cards, hands, decks, and game flow.
+
+2. **Set Up the Poker Game Class**
+   - Create `PokerGame.cs` in `Poker/Game/` inheriting from `CardsGame`.
+   - Implement game state management: lobby, dealing, betting, showdown, etc.
+   - Use the event-driven model for state transitions.
+
+3. **Implement Player Logic**
+   - Create `PokerPlayer.cs` in `Poker/Players/` inheriting from `Player`.
+   - Add properties for chips, current bet, folded status, etc.
+   - Support both human and AI players.
+
+4. **Define Poker Rules**
+   - Create `PokerRules.cs` in `Poker/Rules/`.
+   - Implement hand evaluation (pair, flush, straight, etc.).
+   - Handle betting rounds: pre-flop, flop, turn, river.
+   - Use the Strategy pattern for rule variations if needed.
+
+5. **Build the UI**
+   - Create screens in `Poker/UI/` (e.g., `PokerTableScreen.cs`, `PokerMenuScreen.cs`).
+   - Use the existing ScreenManager for navigation.
+   - Display player hands, community cards, bets, and pot.
+
+6. **Utilities and Helpers**
+   - Place shared logic (e.g., pot calculation, seat rotation) in `Poker/Misc/`.
+
+## Key Concepts
+
+- **Component-Based Design:** Extend or compose game components for animations, transitions, and UI.
+- **Event-Driven Flow:** Use events to trigger state changes and UI updates.
+- **Separation of Concerns:** Keep game logic, rules, UI, and utilities in their respective folders.
+
+## Example: PokerGame Class Skeleton
+
+```csharp
+using Cards.Framework.Game;
+
+namespace Poker.Game {
+    public class PokerGame : CardsGame {
+        // Game state, table, pot, etc.
+        // ...
+        public override void StartGame() {
+            // Initialize table, shuffle, seat players
+        }
+        // ...
+    }
+}
+```
+
+## Tips
+
+- Reuse as much as possible from the framework (deck, hand, player base classes).
+- Study the Blackjack implementation for patterns and best practices.
+- Use the MonoGame Content Pipeline for assets (cards, chips, UI elements).
+- Test incrementally: start with basic dealing and round flow, then add betting and hand evaluation.
+
+## Resources
+
+- [MonoGame Documentation](https://docs.monogame.net/)
+- [Texas Hold 'Em Rules](https://en.wikipedia.org/wiki/Texas_hold_%27em)
+- [Cards Framework Overview](../Framework/)
+
+---
+
+Happy coding! If you have questions, check the existing Blackjack code or ask for help.