public BuildSplitElement(BaseDataBuildingUnit build, MapElementInfo go, NVector pos, ISplitManager ism) : base(build.Name(), build.Sprite()) { this.build = build; this.pos = pos; this.ism = ism; this.go = go; }
public BaseSelectElementSplitElement(string id, T ele, MapElementInfo go, NVector pos, ISplitManager ism, Action <MapElementInfo, NVector> perform, Action <PanelBuilder> inform = null) : base(ele.Name(), ele.Sprite()) { this.id = id; this.ele = ele; this.pos = pos; this.ism = ism; this.go = go; this.perform = perform; this.inform = inform; }
public SplitterViewModel(ISplitManager splitManager) { _SplitManager = splitManager; _SplitManager.OraclePackageSetted += SetModel; ElementsViewModel = new ObservableCollection <SplitterElementViewModel>(); SplitCommand = new RelayCommand(RunSplit, (x) => _splitter != null && !RepositoryObjectWasUpdated); SaveSplitterCommand = new RelayCommand(SaveModel, (x) => _SplitterSaver != null); LoadSplitterCommand = new RelayCommand(LoadModel, (x) => _SplitterSaver != null); }
public ISplitManager Manager() { if (_client == null) { BuildSplitClient(); } _manager = _client.GetSplitManager(); return(_manager); }
public ISplitManager Manager() { if (client == null) { BuildSplitClient(); } manager = client.GetSplitManager(); return(manager); }
public SplitManagerUnitTests() { _blockUntilReadyService = new Mock <IBlockUntilReadyService>(); _splitCache = new Mock <ISplitCache>(); _splitManager = new SplitManager(_splitCache.Object, _blockUntilReadyService.Object); // This line is to clean the warnings. rootFilePath = string.Empty; #if NETCORE rootFilePath = @"Resources\"; #endif }
protected override SplitElement CreateSplitElement(DataBuilding build, MapElementInfo info, NVector pos, ISplitManager ism) { return(new BaseSelectElementSplitElement <DataBuilding>(id, build, info, pos, ism, (mei, position) => { MaterialWindow.ShowBuildMaterialWindow(build, pos, cost => { GameMgmt.Get().building.Create(S.Towns().NearestTown(S.ActPlayer(), pos, false).id, build.id, pos, cost); OnMapUI.Get().UpdatePanel(pos); }); })); }
protected override SplitElement CreateSplitElement(DataUnit build, MapElementInfo info, NVector pos, ISplitManager ism) { return(new BaseSelectElementSplitElement <DataUnit>(id, build, info, pos, ism, (mei, position) => { MaterialWindow.ShowBuildMaterialWindow(build, pos, cost => { GameMgmt.Get().unit.Create(S.ActPlayerID(), build.id, pos, cost); OnMapUI.Get().UpdatePanel(pos); }); })); }
protected override void AddObject(Player player, MapElementInfo info, NVector pos, string key, ISplitManager set) { Spell build = Objects()[key]; if (!info.data.spells.Know(key) || !build.req.Check(player, info, pos, true)) { return; } var be = CreateSplitElement(build, info, pos, set); be.disabled = build.req.Desc(player, info, pos); set.Add(be); //win.AddBuilding(build.id); }
protected override SplitElement CreateSplitElement(Spell spell, MapElementInfo info, NVector pos, ISplitManager ism) { return(new BaseSelectElementSplitElement <Spell>(id, spell, info, pos, ism, (go, position) => { //check ap if (spell.cost > go.data.ap) { ActionHelper.WaitRound(go.data.action, go.data.action.Get("magic"), go, go.Pos(), spell.cost, spell.id, ActionEvent.NextRound); return; } go.data.ap -= spell.cost; Cast(spell, go); })); }
protected abstract SplitElement CreateSplitElement(TU build, MapElementInfo info, NVector pos, ISplitManager set);
protected virtual void AddObject(Player player, MapElementInfo info, NVector pos, string key, ISplitManager set) { TU build = Objects()[key]; if (build.req.Check(player, info, pos, true)) { var be = CreateSplitElement(build, info, pos, set); be.disabled = build.req.Desc(player, info, pos); set.Add(be); //win.AddBuilding(build.id); } }
public BuildUpgradeSplitElement(BaseDataBuildingUnit build, MapElementInfo go, NVector pos, ISplitManager ism) : base(build, go, pos, ism) { }