private async Task <TArg> RunDetail(UnitWithMaster u, S backTo, CancellationToken ct) { var page = await NavigateToDetailView(u); await page.AwaitClose(CancellationToken.None); return(T.Result(backTo, u)); }
private async Task <TArg> RunEnhancement(UnitWithMaster option, CancellationToken ct) { var page = await NavigateToEnhancement(); var tr = new Transition { T.Item(page.AwaitOk, () => { _vm.Enhance(); return(T.Result(S.MaterialSelection, _vm.BaseUnit)); }), T.Item(page.AwaitCancel, () => { return(T.Result(S.MaterialSelection, _vm.BaseUnit)); }), }; return(await tr.Transit()); }
private async Task <TArg> RunBaseSelection(UnitWithMaster u, CancellationToken ct) { var page = await NavigateToBaseSelection(); var tr = new Transition { T.Item(page.AwaitUnitSelect, x => { _vm.BaseUnit = x; return(T.Result(S.MaterialSelection, x)); }), T.Item(page.AwaitUnitDetail, x => { _vm.BaseUnit = x; return(T.Result(S.DetailFromBase, x)); }), T.Item(page.AwaitReturn, () => T.Result(S.Close, default(UnitWithMaster))), }; return(await tr.Transit()); }
private async Task <TArg> RunMaterialSelection(UnitWithMaster u, CancellationToken ct) { var page = await NavigateToMaterialSelection(); var tr = new Transition { T.Item(page.AwaitEnhance, x => { ResetMaterials(x); return(T.Result(S.Enhancement, _vm.BaseUnit)); }), T.Item(page.AwaitUnitDetail, x => { _vm.BaseUnit = x; return(T.Result(S.DetailFromMaterial, x)); }), T.Item(page.AwaitReturn, () => T.Result(S.BaseSelection, default(UnitWithMaster))), }; return(await tr.Transit()); }
/// <summary> /// 強化合成する。 /// </summary> /// <param name="baseUnit">強化ベース。</param> /// <param name="materialUnits">強化素材一覧。</param> public void Enhance(UnitWithMaster baseUnit, IEnumerable <UnitWithMaster> materialUnits) { // 実際にはサーバーと通信して結果をもらう。 // このプログラムは所詮はページ遷移関連のコンセプト確認用のダミーなので適当な強化処理する。 // ・単純に素材になった奴を Units から消す。 // ・素材のレベルの1割(あまり切り上げ)、ベースのレベルを上げる。 foreach (var x in materialUnits) { _units.Remove(x); baseUnit.Unit.Level += (int)Math.Ceiling(x.Level * 0.1); } }
public Task <UnitDetailPage> NavigateToDetailView(UnitWithMaster u) { return(NavigateAsync <UnitDetailPage>(u)); }