private void OnMechanicAdded(MechanicInfo mechanic) { if (IsLoaded) { SkipState(TutorialStateName.Mechanic); } }
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)); } } }
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); } }
public static void OnMechanicStateChanged(MechanicState oldState, MechanicState newState, MechanicInfo mechanic) => MechanicStateChanged?.Invoke(oldState, newState, mechanic);
public static void OnMechanicAdded(MechanicInfo mechanic) => MechanicAdded?.Invoke(mechanic);
public static void OnMechanicWorkCircleCompleted(MechanicInfo mechanic, int circleCount) => MechanicWorkCircleCompleted?.Invoke(mechanic, circleCount);
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)); // } // } //} }