Ejemplo n.º 1
0
 public void GetResources(ResourcePool resPool, Ship ship, SystemLog sysLog)
 {
     if (this.Type == StarSystem.SystemType.Empty)
     {
         return;
     }
     if (!_aCollected[ship.Owner])
     {
         int inf = _aInfluence[ship.Owner];
         resPool.AddMineral((inf * _mineral) / _totalInfluence);
         resPool.AddOrganic((inf * _organic) / _totalInfluence);
         resPool.AddEnergy((inf * _energy) / _totalInfluence);
         _aCollected[ship.Owner] = true;
         sysLog[_index].AddCollectedResourceInfo((inf * _mineral) / _totalInfluence,
                                                 (inf * _organic) / _totalInfluence,
                                                 (inf * _energy) / _totalInfluence);
     }
 }
Ejemplo n.º 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;
            }
            }
        }
Ejemplo n.º 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;
            }
            }
        }
Ejemplo n.º 4
0
 public virtual void DoTask(ResourcePool resPool, SystemLog sysLog, DataMap dataMap)
 {
 }