Esempio n. 1
0
        public MainViewer()
        {
            InitializeComponent();

            // Initializing variables
            _data = new DataPipeline();
            smiteMap = new SmiteMap();
            teamTemp = new List<int>();

            // Create the smite map. We couldn't do it via the Toolbox because VS2012 couldn't detect
            // SFML library even though it was referenced, so we gotta do it the hard way
            smiteMap.Size = new System.Drawing.Size(963, 891);
            smiteMap.Location = new Point(7, 22);
            grpMap.Controls.Add(smiteMap);

            // By default we would have 0 notification
            notification = 0;

            // By default current map isn't set so
            CurrentMap = -1;

            // Repointing to itself, make this a singleton class
            _instance = this;

            // Setting up both default value for client and server
            _client = new Client(txtHostIP.Text, int.Parse(txtClientPort.Text));
            _server = new Server(int.Parse(txtServerPort.Text), txtServerPass.Text, txtAdminName.Text);

            // Defining 4 initial value for colors - all 4 are blacks
            PickedColor = new SFML.Graphics.Color[4];
            for (int i = 0; i < PickedColor.Length; i++)
                PickedColor[i] = new SFML.Graphics.Color(SFML.Graphics.Color.Black);

            // By default the instance is not a server
            IsServer = false;

            // For drawings
            CurrentSelectedColor = 0;
            PencilSize = 5;
            CurrentTool = (int)ToolType.Pencil;

            // Initialize the team
            BoardTeam1 = new List<GodInstance>();
            BoardTeam2 = new List<GodInstance>();
        }
        public MainViewer()
        {
            InitializeComponent();
            smiteMap = new SmiteMap();
            smiteMap.Size = new System.Drawing.Size(723, 723);
            smiteMap.Location = new Point(6, 19);
            grpMap.Controls.Add(smiteMap);
            notification = 0;

            _instance = this;
            _client = new Client(txtHostIP.Text, int.Parse(txtClientPort.Text));
            _server = new Server(int.Parse(txtServerPort.Text), txtServerPass.Text, txtAdminName.Text);
            PickedColor = new SFML.Graphics.Color[4];
            for (int i = 0; i < PickedColor.Length; i++)
                PickedColor[i] = new SFML.Graphics.Color();

            IsServer = false;
            CurrentSelectedColor = 0;
            PencilSize = 5;
            CurrentTool = (int)ToolType.Pencil;
        }