Esempio n. 1
0
 private void OnMechanicAdded(MechanicInfo mechanic)
 {
     if (IsLoaded)
     {
         SkipState(TutorialStateName.Mechanic);
     }
 }
Esempio n. 2
0
 private void OnMechanicWorkCompleted(MechanicInfo mechanic, int workCyrcles)
 {
     if (mechanic.Count > 0)
     {
         int brokenedCount = Services.TransportService.GetUnitBrokenedCount(mechanic.Id);
         if (brokenedCount > 0)
         {
             int repairCount = Mathf.Min(brokenedCount, mechanic.Count * workCyrcles);
             int repaired    = Services.TransportService.Repair(mechanic.Id, repairCount);
             //UDebug.Log($"mechanic => {mechanic.Id} was repaired => {repaired} transports...".Colored(ConsoleTextColor.green));
         }
     }
 }
Esempio n. 3
0
        public void AddMechanic(int generatorId, int count)
        {
            MechanicInfo mechanic = null;

            if (Mechanics.ContainsKey(generatorId))
            {
                mechanic = Mechanics[generatorId];
                mechanic.AddMechanic(count);
            }
            else
            {
                mechanic = new MechanicInfo(generatorId, count);
                Mechanics.Add(mechanic.Id, mechanic);
                GameEvents.OnMechanicAdded(mechanic);
            }
        }
Esempio n. 4
0
 public static void OnMechanicStateChanged(MechanicState oldState, MechanicState newState, MechanicInfo mechanic)
 => MechanicStateChanged?.Invoke(oldState, newState, mechanic);
Esempio n. 5
0
 public static void OnMechanicAdded(MechanicInfo mechanic)
 => MechanicAdded?.Invoke(mechanic);
Esempio n. 6
0
 public static void OnMechanicWorkCircleCompleted(MechanicInfo mechanic, int circleCount)
 => MechanicWorkCircleCompleted?.Invoke(mechanic, circleCount);
Esempio n. 7
0
 private void OnMechanicStateChanged(MechanicState oldState, MechanicState newState, MechanicInfo mechanic)
 {
     //if(mechanic.Count > 0 ) {
     //    if(mechanic.State == MechanicState.Completed ) {
     //        int brokenedCount = Services.TransportService.GetUnitBrokenedCount(mechanic.Id);
     //        if(brokenedCount > 0 ) {
     //            int repairCount = Mathf.Min(brokenedCount, mechanic.Count);
     //            int repaired = Services.TransportService.Repair(mechanic.Id, repairCount);
     //            UDebug.Log($"mechanic => {mechanic.Id} was repaired => {repaired} transports...".Colored(ConsoleTextColor.green));
     //        }
     //    }
     //}
 }