Пример #1
0
 public HexArray(DataMap dataMap)
 {
     _mapWidth  = dataMap.Width;
     _mapHeight = dataMap.Height;
     _hexArray  = new Hex [_mapWidth, _mapHeight];
     _wormhole  = dataMap.Wormhole;
     for (int y = 0; y < _mapHeight; y++)
     {
         for (int x = 0; x < _mapWidth; x++)
         {
             _hexArray[x, y]       = new Hex(dataMap[x, y]);
             _hexArray[x, y].Index = new Point(x, y);
         }
     }
 }
Пример #2
0
        public override void DoTask(ResourcePool resPool, SystemLog sysLog, DataMap dataMap)
        {
            switch (_currentTask)
            {
            case Task.Base:
            {
                break;
            }

            case Task.Collect:
            {
                if (dataMap[_hexLocation.X, _hexLocation.Y].System == null)
                {
                    _currentTask = Task.Survey;
                    goto case Task.Survey;
                }
                else
                {
                    StarSystem system = dataMap[_hexLocation.X, _hexLocation.Y].System;
                    sysLog.AddInfo(dataMap[this.HexLocation.X, this.HexLocation.Y]);
                    system.GetResources(resPool, this, sysLog);
                    this._acted = true;
                }
                break;
            }

            case Task.Survey:
            {
                sysLog.AddInfo(dataMap[this.HexLocation.X, this.HexLocation.Y]);
                this._acted = true;
                break;
            }

            case Task.Move:
            {
                break;
            }

            default:
            {                           //collect
                break;
            }
            }
        }
Пример #3
0
        public override void DoTask(ResourcePool resPool, SystemLog sysLog, DataMap dataMap)
        {
            switch (_currentTask)
            {
            case Task.Survey:
            {
                sysLog.AddInfo(dataMap[this.HexLocation.X, this.HexLocation.Y]);
                this._acted = true;
                break;
            }

            case Task.Move:
            {
                break;
            }

            default:
            {
                sysLog.AddInfo(dataMap[this.HexLocation.X, this.HexLocation.Y]);
                this._acted = true;
                break;
            }
            }
        }
Пример #4
0
 public virtual void DoTask(ResourcePool resPool, SystemLog sysLog, DataMap dataMap)
 {
 }