Beispiel #1
0
 public static CardCollect Get2Joker()
 {
     CardCollect cc = new CardCollect();
     cc.Add(new Card(CardValueType.BlackJoker, CardSuiteType.Joker));
     cc.Add(new Card(CardValueType.RedJoker, CardSuiteType.Joker));
     return cc;
 }
Beispiel #2
0
 // A-10
 public static CardCollect Get10(CardSuiteType t)
 {
     CardCollect cc = new CardCollect();
     for (byte b = 1; b <= 10; ++b)
     {
         cc.Add(new Card((CardValueType)b, t));
     }
     return cc;
 }
Beispiel #3
0
 public int Compare(CardCollect ccA, CardCollect ccB)
 {
     int a = s4.Run(ccA);
     int b = s4.Run(ccB);
     if (a > b)
         return 1;
     else if (b > a)
         return -1;
     return 0;
 }
Beispiel #4
0
 public CardCollect Run(CardCollect cc)
 {
     CozyLuaCore lua = new CozyLuaCore();
     lua.LoadCLRPackage();
     lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Model')");
     lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Util')");
     lua.DoFile(PathTransform.LuaScript(script_));
     var f = lua.GetFunction("deal");
     return (CardCollect)f.Call(cc).First();
 }
Beispiel #5
0
 public void Run(CardCollect cc)
 {
     CozyLuaCore lua = new CozyLuaCore();
     lua.LoadCLRPackage();
     lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Model')");
     lua.DoString("import ('CozyPoker.Engine', 'CozyPoker.Engine.Util')");
     lua.DoFile(PathTransform.LuaScript(script_));
     var f = lua.GetFunction("shuffle");
     f.Call(cc);
 }
Beispiel #6
0
 // A-K no 2
 public static CardCollect Get12(CardSuiteType t)
 {
     CardCollect cc = new CardCollect();
     for (byte b = 1; b <= 13; ++b)
     {
         if (b == 2) continue;
         cc.Add(new Card((CardValueType)b, t));
     }
     return cc;
 }
Beispiel #7
0
 public static CardCollect GetAPoker(bool bNeedJoker = true, bool bNeed2 = true)
 {
     CardCollect cc = new CardCollect();
     if (bNeedJoker)
     {
         cc.Add(Get2Joker().Cards);
     }
     if (bNeed2)
     {
         cc.Add(Get13(CardSuiteType.Clubs).Cards);
         cc.Add(Get13(CardSuiteType.Diamons).Cards);
         cc.Add(Get13(CardSuiteType.Hearts).Cards);
         cc.Add(Get13(CardSuiteType.Spades).Cards);
     }
     else
     {
         cc.Add(Get12(CardSuiteType.Clubs).Cards);
         cc.Add(Get12(CardSuiteType.Diamons).Cards);
         cc.Add(Get12(CardSuiteType.Hearts).Cards);
         cc.Add(Get12(CardSuiteType.Spades).Cards);
     }
     return cc;
 }
Beispiel #8
0
 // 模式是洗牌->发几组牌->比较大小
 public void Shuffle()
 {
     cc_ = s1.Run();
     s2.Run(cc_);
 }
Beispiel #9
0
 public void Shuffle()
 {
     cc = NormalCardCollect.GetAPoker(false);
     cc.Shuffle();
 }