Exemplo n.º 1
0
        public PatchAgent()
        {
            InitializeComponent();

            Int32[] Widths = new Int32[(Int32)EField.Max]
            {
                650,
                50
            };

            AgentFields = new System.Windows.Forms.ColumnHeader[(Int32)EField.Max];
            for (Int32 i = 0; i < (Int32)EField.Max; ++i)
            {
                AgentFields[i]       = new System.Windows.Forms.ColumnHeader();
                AgentFields[i].Text  = ((EField)i).ToString();
                AgentFields[i].Width = Widths[i];
            }

            lvUpdateList.Columns.AddRange(AgentFields);
            //lvUpdateList.Location = new System.Drawing.Point(13, 39);
            //lvUpdateList.Size = new System.Drawing.Size(989, 677);
            lvUpdateList.UseCompatibleStateImageBehavior = false;
            lvUpdateList.FullRowSelect      = true;
            lvUpdateList.ListViewItemSorter = new ListViewItemComparer(lvUpdateList.Sorting, 0);

            btnLogout.Enabled = false;
            btnSub.Enabled    = false;
            btnAdd.Enabled    = false;
            btnDel.Enabled    = false;
            btnUpdate.Enabled = false;
            btnReset.Enabled  = false;

            try
            {
                _Option = new COptionJson <SOption>("Option.ini", false);

                tbID.Text = _Option.Data.ID;
                tbPW.Text = _Option.Data.PW;

                _Net = new CAgent(_Option.Data.DataFileName, _Option.Data.DataPath, new CNamePort(_Option.Data.MasterNamePort), Link, LinkFail, UnLink, DataCallback);

                lbFullData.ColumnWidth = Width;
                foreach (var i in _Net.GetData().Files)
                {
                    lbFullData.Items.Add(i.Key);
                }

                SetVersion(_Net.GetData().Version);
                timerNet.Enabled = true;
            }
            catch (Exception Exception_)
            {
                Log(Exception_.ToString());
            }
        }
Exemplo n.º 2
0
        private void DoTurnAI()
        {
            var agent = new CAgent();

            agent.ProcessTurn(this._data.Target);
        }