Exemplo n.º 1
0
 public Deployment(string name, Region destination, IDeployable deployable, CostOfStage cost) :
     base(name, cost)
 {
     DeployableObject = deployable;
     Destination      = destination;
     Cost             = cost;
 }
Exemplo n.º 2
0
        public static List <Transportation> Create(string name, IDeployable deployable,
                                                   Region from, Region to, CostOfStage cost)
        {
            var            list  = new List <Transportation>();
            var            route = Misc.ShortestPath(from, to);
            var            iter  = route.First;
            Transportation prev  = null;

            while (iter.Next != null)
            {
                Transportation transportation;

                transportation = new Transportation($"Transferring {deployable} to a new destination: {to}", deployable, iter.Next.Value,
                                                    ResourceManager.GetCostOf(nameof(Installation), TypesOfCostOfStage.Transportation));

                if (prev != null)
                {
                    prev._AfterCompleted = p => transportation.IsPending = false;
                }

                list.Add(transportation);

                prev = transportation;
                iter = iter.Next;
            }

            return(list);
        }
Exemplo n.º 3
0
 public Transportation(string name, IDeployable deployable, Region nextStop,
                       CostOfStage cost, Action <Transportation> afterCompleted = null) : base(name, cost)
 {
     Name            = name;
     Cargo           = deployable;
     Cost            = cost;
     NextStop        = nextStop;
     IsPending       = true;
     _AfterCompleted = afterCompleted;
 }
Exemplo n.º 4
0
 // Any object that is manufactured will not be automatically added to anywhere.
 // Its destination should always be explicitly stated.
 // e.g. send it to reserve
 public Manufacture(string name, Func <IDestroyable> produce, CostOfStage cost, Action <Manufacture> afterCompleted = null)
     : base(name, cost)
 {
     _Produce        = produce;
     _AfterCompleted = afterCompleted;
 }
Exemplo n.º 5
0
 public Policy(string name, CostOfStage cost, Action action) :
     base(name, cost)
 {
     _Action = action;
 }
Exemplo n.º 6
0
 protected Task(string name, CostOfStage cost)
 {
     GameManager.TimeElapsed += AdvanceProgress;
     Name = name;
     Cost = cost;
 }