Exemplo n.º 1
0
 public void SetMap(PredefinedTypes.Map map)
 {
     if (_mMainForm != null &&
         _mMainForm.IsLoaded)
     {
         _mMainForm.Map = map;
     }
 }
Exemplo n.º 2
0
 public void SetGameinfo(PredefinedTypes.Gameinformation gameinfo)
 {
     if (_mMainForm != null &&
         _mMainForm.IsLoaded)
     {
         _mMainForm.Gameinfo = gameinfo;
     }
 }
Exemplo n.º 3
0
        public static void SetWindowStyle(IntPtr handle, PredefinedTypes.CustomWindowStyles wndStyle)
        {
            if (wndStyle.Equals(PredefinedTypes.CustomWindowStyles.Clickable))
            {
                var initial = InteropCalls.GetWindowLong(handle, (Int32)InteropCalls.Gwl.ExStyle);
                InteropCalls.SetWindowLong(handle, (Int32)InteropCalls.Gwl.ExStyle,
                                            (IntPtr)(initial & ~(Int32)InteropCalls.Ws.ExTransparent));
            }

            else if (wndStyle.Equals(PredefinedTypes.CustomWindowStyles.NotClickable))
            {
                var initial = InteropCalls.GetWindowLong(handle, (Int32)InteropCalls.Gwl.ExStyle);
                InteropCalls.SetWindowLong(handle, (Int32)InteropCalls.Gwl.ExStyle,
                                            (IntPtr)(initial | (Int32)InteropCalls.Ws.ExTransparent));
            }
        }
Exemplo n.º 4
0
 public void SetSelection(PredefinedTypes.LSelection selection)
 {
     //Nope
 }
Exemplo n.º 5
0
 public void SetPlayers(PredefinedTypes.PList players)
 {
     if (_mainWindows != null)
         _mainWindows.Players = players;
 }
Exemplo n.º 6
0
 public void SetMap(PredefinedTypes.Map map)
 {
     //Nope
 }
Exemplo n.º 7
0
 public void SetGameinfo(PredefinedTypes.Gameinformation gameinfo)
 {
     if (_mainWindows != null)
         _mainWindows.Gameinfo = gameinfo;
 }
Exemplo n.º 8
0
 public void SetGameinfo(PredefinedTypes.Gameinformation gameinfo)
 {
     if (_pData != null)
         _pData.Gameinfo = gameinfo;
 }
Exemplo n.º 9
0
 public void SetPlayers(PredefinedTypes.PList players)
 {
     _frmExternal.Players = players;
 }
Exemplo n.º 10
0
 public void SetSelection(PredefinedTypes.LSelection selection)
 {
     if (_mMainForm != null &&
         _mMainForm.IsLoaded)
     {
         _mMainForm.Selection = selection;
     }
 }
Exemplo n.º 11
0
        private void AddSelectionData(int startIndex, int endIndex, PredefinedTypes.LSelection list, ListBox lstBx)
        {
            if (list == null ||
                list.Count <= 0)
                return;

            var lUnitNames = new List<String>();

            for (var index = startIndex; index < endIndex; index++)
            {
                var u = list[index].Unit;

                //var cl = Color.FromArgb(p.Color.A, p.Color.R, p.Color.G, p.Color.B);

                #region Add ' ' to line the unitnames up [between [INDEX] UNITNAME]

                var iUnitCountLenght = list.Count.ToString(CultureInfo.InvariantCulture).Length;
                var strResult = "[" + index + "]";

                for (var i = 0; i <= iUnitCountLenght - index.ToString(CultureInfo.InvariantCulture).Length; i++)
                    strResult += " ";

                strResult += u.Name;

                #endregion

                lUnitNames.Add(strResult);

                //LstUnit.Items.Add(new ListBoxItem2(strResult, Brushes.Black, new SolidColorBrush(cl)));
            }

            var tmpUnitNames = new List<String>();
            for (var i = 0; i < list.Count; i++)
                tmpUnitNames.Add(list[i].Unit.Name);

            /* Sort the string- lenght - short to long */
            tmpUnitNames.Sort((x, y) => (x.Length.CompareTo(y.Length)));

            var iMinLenght = tmpUnitNames[0].Length;
            var iMaxLenght = tmpUnitNames[tmpUnitNames.Count - 1].Length + 2 + list.Count.ToString(CultureInfo.InvariantCulture).Length;

            for (int index = 0; index < lUnitNames.Count; index++)
            {
                var s = lUnitNames[index];

                for (var i = 0; i <= iMaxLenght - s.Length; i++)
                {
                    lUnitNames[index] += " ";
                }

                lUnitNames[index] += " Owner: " + Players[list[index + startIndex].Unit.Owner].Name;
            }

            foreach (var s in lUnitNames)
                lstBx.Items.Add(s);
        }
Exemplo n.º 12
0
        private void AddPlayerData(int startIndex, int endIndex, PredefinedTypes.PList list, ListBox lstBx)
        {
            for (var index = startIndex; index < endIndex; index++)
            {
                var p = list[index];
                if (p.NameLength <= 3 ||
                    p.Type.Equals(PredefinedTypes.PlayerType.Hostile)) continue;

                var cl = Color.FromArgb(p.Color.A, p.Color.R, p.Color.G, p.Color.B);

                var iPlayerCountLenght = Players.Count.ToString(CultureInfo.InvariantCulture).Length;
                var strResult = "[" + index + "]";

                for (var i = 0; i <= iPlayerCountLenght - index.ToString(CultureInfo.InvariantCulture).Length; i++)
                    strResult += " ";

                strResult += p.Name;

                lstBx.Items.Add(new ListBoxItem2(strResult, Brushes.Black, new SolidColorBrush(cl)));
            }
        }
Exemplo n.º 13
0
 public void SetSelection(PredefinedTypes.LSelection selection)
 {
     if (_pData != null)
         _pData.Selections = selection;
 }
Exemplo n.º 14
0
 public void SetPlayers(PredefinedTypes.PList players)
 {
     if (_pData != null)
         _pData.Players = players;
 }
Exemplo n.º 15
0
 public void SetMap(PredefinedTypes.Map map)
 {
     if (_pData != null)
         _pData.Map = map;
 }
Exemplo n.º 16
0
 public void SetGameinfo(PredefinedTypes.Gameinformation gameinfo)
 {
     _frmExternal.Gameinfo = gameinfo;
 }
Exemplo n.º 17
0
 public void SetMap(PredefinedTypes.Map map)
 {
     _frmExternal.Map = map;
 }
Exemplo n.º 18
0
 public void SetPlayers(PredefinedTypes.PList players)
 {
     if (_mMainForm != null &&
         _mMainForm.IsLoaded)
     {
         _mMainForm.Players = players;
     }
 }
Exemplo n.º 19
0
 public void SetSelection(PredefinedTypes.LSelection selection)
 {
     _frmExternal.Selection = selection;
 }
Exemplo n.º 20
0
        private void CommandCenter(ref List<Keys> keys, PredefinedTypes.Unit unit, PredefinedTypes.Unit oldUnit, Keys scvKey, float buildNextScvAt)
        {
            if (unit.ProdNumberOfQueuedUnits <= 0)
            {
                keys.Add(scvKey);
            }

            else if (unit.ProdNumberOfQueuedUnits == 1)
            {
                if (unit.ProdProcess[0] >= buildNextScvAt)
                    keys.Add(scvKey);
            }
        }