public InteractiveModel( LoadModel model)
 {
     this.model=model;
     this.elapsedTime = 0;
     this.lifeBar = new HUD.LifeBar(1);
     this.circle = new HUD.Circle();
     this.myNode = getMyNode();
 }
Esempio n. 2
0
        public static void TestAnalyzer()
        {
            var myCards = new List<Card>()
            {
                new Card(CardSuit.Club, CardType.Ace),
                new Card(CardSuit.Heart, CardType.King),
                new Card(CardSuit.Club, CardType.Nine),
                new Card(CardSuit.Spade, CardType.Ten),
                new Card(CardSuit.Diamond, CardType.Nine),
                new Card(CardSuit.Heart, CardType.Ten),
            };

            var oppCards = new List<Card>()
            {
                new Card(CardSuit.Club, CardType.Ten),
                new Card(CardSuit.Heart, CardType.Queen),
                new Card(CardSuit.Spade, CardType.Ace),
                new Card(CardSuit.Spade, CardType.Nine),
                new Card(CardSuit.Diamond, CardType.Jack),
                new Card(CardSuit.Heart, CardType.Jack),
            };

            var root = new Node(null, new Card(CardSuit.Diamond, CardType.Ace), true);

            EndgameAnalyzer.Compute(root, null, myCards, oppCards, 40, 40);

            output = new StringBuilder();
            OutInBuilder(root);

            // File.WriteAllText("../../report.txt", output.ToString());

            foreach (var c in root.Children)
            {
                Console.WriteLine(c.Wins + "/" + c.Total + " " + c.Card);
            }

            Console.WriteLine(root.Wins + " " + root.Total);
        }
Esempio n. 3
0
        static void OutInBuilder(Node root)
        {
            var nodes = new Stack<Node>();

            nodes.Push(root);

            while (nodes.Count > 0)
            {
                var current = nodes.Pop();

                output.AppendLine(current.ToString());

                if (current.Children.Count == 0)
                {
                    break;
                }

                foreach (var c in current.Children)
                {
                    nodes.Push(c);
                }
            }
        }