コード例 #1
0
ファイル: BuildingDock.cs プロジェクト: sandisks/Projects
 private void Tick(object sender, ElapsedEventArgs e)
 {
     OnPropertyChanged(nameof(CompleteTime));
     OnPropertyChanged(nameof(DuringTime));
     if (State == DockState.Building && Config.Current.NotifyWhenBuild && CompleteTime.InASecond())
     {
         NotifierFactories.Current?.Show(StringTable.Notification_Build_Title,
                                         string.Format(StringTable.Notification_Build_Text, Id, Config.Current.ShowBuildingShipName ? $"「{CreatedShip.Name}」" : StringTable.Ship_LowerCase),
                                         Config.MakeSoundWithPath(Config.Current.NotifyBuildSound));
     }
 }
コード例 #2
0
ファイル: RepairDock.cs プロジェクト: sandisks/Projects
 private void Tick(object sender, ElapsedEventArgs e)
 {
     OnPropertyChanged(nameof(CompleteTime));
     if (Ship != null)
     {
         if (Ship.RepairingHP == Ship.HP.Max)
         {
             return;
         }
         Ship.RepairingHP = Ship.HP.Max - (int)Math.Ceiling(CompleteTime.Remain().TotalSeconds / Ship.RepairTimePerHP.TotalSeconds);
     }
     if (State == DockState.Repairing && Config.Current.NotifyWhenRepair && CompleteTime.InASecond(Config.Current.NotifyTimeAdjust))
     {
         NotifierFactories.Current?.Show(StringTable.Notification_Repair_Title,
                                         string.Format(StringTable.Notification_Repair_Text, Id, Ship.ShipInfo.Name),
                                         Config.MakeSoundWithPath(Config.Current.NotifyRepairSound));
     }
 }