internal CanStartRoom( MainWindow window, StatusCollection status, Int64 now, Garner garner, Boolean checkClosing = false, List <Room>?rooms = null ) { this.window = window; this.status = status; this.now = now; this.garner = garner; this.checkClosing = checkClosing; this.rooms = rooms; // giftHistory.count() を呼ぶ前に必ずexpectedResetを呼ばないといけない this.expectedReset = garner.giftHistory.expectedReset(now); // historyCount は外部から参照されるreadonly変数なのでこのタイミングで初期化したい this.historyCount = garner.giftHistory.count(); // 初期化時に検討までやってしまう this.remainStartRoom = check(); }
public GarnerSettingDialog(MainWindow mainWindow, Garner garner) { this.mainWindow = mainWindow; this.garner = garner; this.Owner = mainWindow; this.WindowStartupLocation = WindowStartupLocation.CenterOwner; this.SourceInitialized += (x, y) => this.HideMinimizeAndMaximizeButtons(); InitializeComponent(); Title = $"{garner.itemName}の設定"; SoundActor.initListBox(lbSoundActor, garner.soundActor); lbSoundActor.SelectionChanged += (sender, e) => updateApplyButton(); btnTestSoundActor.Click += (sender, e) => testSound(); btnCancel.Click += (sender, e) => Close(); btnOk.Click += (sender, e) => { save(); Close(); }; btnApply.Click += (sender, e) => { save(); updateApplyButton(); }; updateApplyButton(); }