Пример #1
0
 public void Setup(IMineable mineable, double requiredMiningLevel, double speed, Action <Creature> lootFunction)
 {
     Mineable            = mineable;
     RequiredMiningLevel = requiredMiningLevel;
     Speed        = speed;
     LootFunction = lootFunction;
 }
Пример #2
0
    public void ActOnEntity(Entity entity)
    {
        // Get this ship's available actions from blueprint

        // Get all actions that can act on this entity

        // For now, this ship can only mine

        Debug.Log("ActOnEntity");
        IMineable i = entity as IMineable;

        if (i != null)
        {
            if (CmpMining)
            {
                // TODO: Check mining equipment range
                MineCommand command = new MineCommand(this, i);
                CurrentCommand = command;
                CommandQueue.Clear();
                GeneralManager.Instance.SetShipState(this, EntityState.Active);
            }
            else
            {
                Debug.Log("Ship has no Mining attachment!");
            }
        }
    }
Пример #3
0
 public JobMine(SystemMine system, IBuilding building)
     : base(system, building, $"Mine {building.def.name}.") // TODO: tool type
 {
     BB.AssertNotNull(building);
     mineable = (IMineable)building;
     BB.AssertNotNull(mineable);
 }
 public MineCommand(Ship ship, IMineable target)
 {
     this._ship           = ship;
     this._target         = target;
     this._resourceData   = ResourceManager.Instance.GetResource(this._target.GetResourceType());
     this._cmpMining      = ship.CmpMining;
     this._minedPerTick   = _cmpMining.MinedPerTick;
     this._cmpCargo       = ship.CmpCargo;
     this._miningProgress = 0;
 }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     StrategicClock.PhaseChange.AddListener(PhaseManager);
     target = GetComponent <IMineable>();
     Collections.Mines.Add(this);
     Collections.ResourceSources.Add(this);
     if (GetComponent <Asteroid>())
     {
         resource = GetComponent <Asteroid>().deposit.resource;
     }
 }