/// <summary> /// This method returns any CardCountingSystems you want to show up as an option. /// </summary> /// <returns></returns> public static List <ICardCountingSystem> LoadCardCountingSystems() { // Create the return value List <ICardCountingSystem> cardCountingSystems = new List <ICardCountingSystem>(); // Create all the card counting systems BasicStrategySystem basicStrategySystem = new BasicStrategySystem(); HighLowSystem highLowSystem = new HighLowSystem(); KnockOutSystem knockOutSystem = new KnockOutSystem(); KISSIISystem kissIISystem = new KISSIISystem(); KISSIIISystem kissIIISystem = new KISSIIISystem(); HighOptISystem highOpt1System = new HighOptISystem(); HighOptIISystem highOpt2System = new HighOptIISystem(); WongHalvesSystem wongHalvesSystem = new WongHalvesSystem(); // add each system cardCountingSystems.Add(basicStrategySystem); cardCountingSystems.Add(highLowSystem); cardCountingSystems.Add(knockOutSystem); cardCountingSystems.Add(kissIISystem); cardCountingSystems.Add(kissIIISystem); cardCountingSystems.Add(highOpt1System); cardCountingSystems.Add(highOpt2System); cardCountingSystems.Add(wongHalvesSystem); // return value return(cardCountingSystems); }
/// <summary> /// This method Display Player /// </summary> private void DisplayPlayer() { // locals bool isSeated = false; bool isComputerPlayer = false; int countSystemIndex = -1; string name = ""; string chips = "$.0.00"; // If the Player object exists if (this.HasPlayer) { // set the values isSeated = this.Player.Seated; ICardCountingSystem countingSystem = this.Player.CardCountingSystem; name = this.Player.Name; chips = "$" + String.Format("{0:n0}", this.Player.Chips); isComputerPlayer = this.Player.IsComputerPlayer; // if the countingSystem exists if (NullHelper.Exists(countingSystem)) { // Find the countSystemIndex countSystemIndex = FindCountSystemIndex(countingSystem); } else { // Find the countSystemIndex HighLowSystem highLow = new HighLowSystem(); countSystemIndex = FindCountSystemIndex(highLow); } } // Check the box if seated this.IsComputerPlayerCheckBox.Checked = isComputerPlayer; this.SeatNumberCheckBox.Checked = isSeated; this.CountingSystemControl.SelectedIndex = countSystemIndex; this.NameControl.Text = name; this.ChipsControl.Text = chips; }
/// <summary> /// This method returns the Card Counting System /// </summary> internal static ICardCountingSystem FindCardCountingSystem(string countingSystemName) { // initial value ICardCountingSystem countingSystem = null; // If the countingSystemName string exists if (TextHelper.Exists(countingSystemName)) { // determine the CountingSystem to return based upon the CountingSystemName switch (countingSystemName) { case "Basic Strategy (No Count)": // Create this countingSystem countingSystem = new BasicStrategySystem(); // required break; case "High - Low": // Create this countingSystem countingSystem = new HighLowSystem(); // required break; case "High Opt I": // Create this countingSystem countingSystem = new HighOptISystem(); // required break; case "High Opt II": // Create this countingSystem countingSystem = new HighOptIISystem(); // required break; case "KISS II": // Create this countingSystem countingSystem = new KISSIISystem(); // required break; case "KISS III": // Create this countingSystem countingSystem = new KISSIIISystem(); // required break; case "Wong Halves": // Create this countingSystem countingSystem = new WongHalvesSystem(); // required break; case "Knock Out": // Create this countingSystem countingSystem = new KnockOutSystem(); // required break; } } // return value return(countingSystem); }