Exemplo n.º 1
0
        public CourtView(MatchInformation matchInfomation)
        {
            InitializeComponent();

            Court1FieldRect = new Rectangle();
            Court1FieldRect.Stroke = Brushes.Black;
            Court1FieldRect.StrokeThickness = 1;
            Court1FieldRect.VerticalAlignment = VerticalAlignment.Top;
            Court1LayoutGrid.Children.Add(Court1FieldRect);

            Court2FieldRect = new Rectangle();
            Court2FieldRect.Stroke = Brushes.Black;
            Court2FieldRect.StrokeThickness = 1;
            Court2FieldRect.VerticalAlignment = VerticalAlignment.Bottom;
            Court2LayoutGrid.Children.Add(Court2FieldRect);

            // Labels
            if (matchInfomation == null)
            {
                CreatePlayerLabel(Court1Player1NameLabel, Court1Player1DescriptionLabel);
                CreatePlayerLabel(Court1Player2NameLabel, Court1Player2DescriptionLabel);
                CreatePlayerLabel(Court2Player1NameLabel, Court2Player1DescriptionLabel);
                CreatePlayerLabel(Court2Player2NameLabel, Court2Player2DescriptionLabel);
            }
            else
            {
                CreatePlayerLabel(Court1Player1NameLabel, Court1Player1DescriptionLabel, matchInfomation.Team1.player1);
                CreatePlayerLabel(Court1Player2NameLabel, Court1Player2DescriptionLabel, matchInfomation.Team1.player2);
                CreatePlayerLabel(Court2Player1NameLabel, Court2Player1DescriptionLabel, matchInfomation.Team2.player1);
                CreatePlayerLabel(Court2Player2NameLabel, Court2Player2DescriptionLabel, matchInfomation.Team2.player2);
            }
        }
Exemplo n.º 2
0
            public static IList <MatchInformation> LoadFile(string filename, string nameFighter1)
            {
                var lines = File.ReadAllLines(filename);

                var matchInfos = new List <MatchInformation>();

                foreach (var line in lines.Skip(1))
                {
                    var values = line.Split(';');

                    if (values.Length < 7)
                    {
                        continue;
                    }

                    var matchInfo = new MatchInformation()
                    {
                        Fighter1    = nameFighter1,
                        Fighter2    = values[0],
                        Result      = values[1],
                        Method      = values[2],
                        Competition = values[3],
                        WeightClass = values[4],
                        Round       = values[5],
                        Year        = values[6],
                    };

                    matchInfos.Add(matchInfo);
                }

                return(matchInfos);
            }
Exemplo n.º 3
0
        private void SetExpressionResult()
        {
            // Clear any source text highlight
            ClearTextHighlight();

            // Show the Status message
            StatusTextBox.Text = statusFromThread;

            // Hide the tree (reduce drawing)
            MatchInformation.Hide();

            // Clear the previous Matches
            MatchInformation.SelectedNode = null; // problem - colorization kept after match
            MatchInformation.Nodes.Clear();

            // Build the Tree and highlight the matches
            foreach (TreeNode matchNode in matchesFromThread)
            {
                MatchInformation.Nodes.Add(matchNode);

                Region matchRegion = (Region)matchNode.Tag;
                HighlightTextRegion(matchRegion.Index, matchRegion.Length);
            }

            // Expand the Tree
            MatchInformation.ExpandAll();

            // Show the tree again
            MatchInformation.Show();

            // Write the code which produces the expression
            if (statusFromThread.Length > 0)
            {
                string codeExpression = ExpressionString();

                if (codeExpression.Length > 0)
                {
                    StatusTextBox.Text += "\r\n" + codeExpression;
                }
            }

            lastStatusWritten = StatusTextBox.Text;
        }
Exemplo n.º 4
0
 public override void JoinMatch(MatchInformation match, string password = null)
 {
     this.RaiseOnJoinError();
 }
Exemplo n.º 5
0
 public override void JoinMatch(MatchInformation match, string password = null)
 {
     this._networkManager.networkAddress = match.connections[0].publicAddress;
     this._networkManager.networkPort    = match.connections[0].port;
     this._networkManager.StartClient();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Called when a match is started.
 /// </summary>
 /// <param name="matchInformation">Information about the match.</param>
 public void MatchStarted(MatchInformation matchInformation)
 {
 }
Exemplo n.º 7
0
 public abstract void JoinMatch(MatchInformation match, string password = null);
Exemplo n.º 8
0
 public override void JoinMatch(MatchInformation match, string password = null)
 {
     this._networkManager.JoinMatch(match.unityNetworkId, password);
 }