public override void OnCreateView(LayoutInflater inflater, ViewGroup container) { base.OnCreateView(inflater, container); #region Desinger Stuff SetContentView(Resource.Layout.FragmentMatches, inflater, container); this.HasOptionsMenu = true; #endregion this.Title = "Agenda"; this.ActionBar.Show(); _adapter = new MatchAdapter(this, new Match[0]); this.MatchList.SetAdapter(_adapter); this.MatchList.ItemSelected += MatchList_ItemSelected;; if (_currentTournament != null) { RefreshMatches(); } }
internal List <MatchEntity> GetMatches(int InputId, string SrcRecordId) { List <MatchEntity> results = new List <MatchEntity>(); try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "dnb.StewGetLCMMatchExtended"; StoredProceduresParameterEntity param = new StoredProceduresParameterEntity(); sproc.StoredProceduresParameter.Add(GetParam("@InputId", InputId.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@SrcRecordId", SrcRecordId.ToString(), SQLServerDatatype.VarcharDataType)); //sproc.StoredProceduresParameter.Add(param); DataTable dt; dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString()); if (dt != null && dt.Rows.Count > 0) { results = new MatchAdapter().Adapt(dt); } } catch (Exception) { //Put log to db here throw; } return(results); }
public AIRoot(MatchAdapter Match, Army Army) { this.Match = Match; this.Army = Army; UnitAssignments = new UnitAssigner(this); TileEvaluations = new TileEvaluator(this); }
protected override void OnResume() { base.OnResume(); MatchAdapter = new MatchAdapter(null); MatchAdapter.ItemViewClick += OnItemViewClick; MatchRecyclerView.SetAdapter(MatchAdapter); }
protected override void OnStart() { base.OnStart(); var adapter = new MatchAdapter(Access.MatchService.GetMatches().Where(c => c.Complete == false).ToList()); adapter.ItemClick += OnItemClick; _mRecyclerView.SetAdapter(adapter); }
public List <MatchContract> GetMatchs() { List <MatchContract> matchs = new List <MatchContract>(); foreach (var match in jtm.GetMatchs()) { matchs.Add(MatchAdapter.MatchToMatchContract(match)); } return(matchs); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.Matches_NoAppBar, container, false); var mRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.cardList); mRecyclerView.SetLayoutManager(new LinearLayoutManager(this.Activity)); var adapter = new MatchAdapter(Matches.Where(c => c.Complete == true).ToList()); adapter.ItemClick += OnItemClick; mRecyclerView.SetAdapter(adapter); return(view); }
public void UpdateMatch(MatchContract match) { jtm.UpdateMatch(MatchAdapter.MatchContractToMatch(match)); }
public void DelMatch(MatchContract match) { jtm.DelMatch(MatchAdapter.MatchContractToMatch(match)); }
public MatchContract AddMatch(MatchContract match) { jtm.AddMatch(MatchAdapter.MatchContractToMatch(match)); return(match); }
public HumanMatchPlayerController( MatchAdapter Match, IEnumerable <Army> AllowedArmies, UnitConfigurationRenderer UnitConfigurationRenderer, MatchScreen MatchScreen, KeyController KeyController) { _NewUnitBuffer = new EventBuffer <ValuedEventArgs <UnitView> >(); this.Match = Match; this.AllowedArmies = new HashSet <Army>(AllowedArmies); this.UnitConfigurationRenderer = UnitConfigurationRenderer; _MatchScreen = MatchScreen; _MatchScreen.OnFinishClicked += EndTurn; _MatchScreen.OnUnitAdded += _NewUnitBuffer.Hook <ValuedEventArgs <UnitView> >(AddUnit).Invoke; _MatchScreen.OnPulse += (sender, e) => _NewUnitBuffer.DispatchEvents(); _Controllers = new Dictionary <TurnComponent, Subcontroller> { { TurnComponent.DEPLOYMENT, new DeploymentController(this) }, { TurnComponent.AIRCRAFT, new AircraftController(this) }, { TurnComponent.ANTI_AIRCRAFT, new AntiAircraftController(this) }, { TurnComponent.ARTILLERY, new ArtilleryController(this) }, { TurnComponent.ATTACK, new AttackController(this) }, { TurnComponent.VEHICLE_COMBAT_MOVEMENT, new OverrunController(this) }, { TurnComponent.VEHICLE_MOVEMENT, new MovementController(this, true) }, { TurnComponent.CLOSE_ASSAULT, new CloseAssaultController(this) }, { TurnComponent.NON_VEHICLE_MOVEMENT, new MovementController(this, false) }, { TurnComponent.RESET, new NoOpController(this) }, { TurnComponent.WAIT, new NoOpController(this) }, { TurnComponent.SPECTATE, new NoOpController(this) } }; foreach (TileView t in MatchScreen.MapView.TilesEnumerable) { t.OnClick += OnTileClick; t.OnRightClick += OnTileRightClick; } foreach (UnitView u in _MatchScreen.UnitViews) { AddUnit(u); } _KeyController = KeyController; KeyController.OnKeyPressed += OnKeyPressed; MatchScreen.LoadButton.OnClick += (sender, e) => LoadUnit(_CurrentTurn.TurnComponent != TurnComponent.DEPLOYMENT); MatchScreen.UnloadButton.OnClick += (sender, e) => UnloadUnit(); MatchScreen.FortifyButton.OnClick += (sender, e) => FortifyUnit(); MatchScreen.AbandonButton.OnClick += (sender, e) => AbandonUnit(); MatchScreen.DismountButton.OnClick += (sender, e) => Dismount(); MatchScreen.MountButton.OnClick += (sender, e) => Mount(); MatchScreen.EvacuateButton.OnClick += (sender, e) => Evacuate(); MatchScreen.ReconButton.OnClick += (sender, e) => Recon(); MatchScreen.ClearMinefieldButton.OnClick += (sender, e) => ClearMinefield(); MatchScreen.EmplaceButton.OnClick += (sender, e) => Emplace(); _AllowedActions = new Dictionary <Button, Func <bool> > { { MatchScreen.LoadButton, () => _Controllers[_CurrentTurn.TurnComponent].CanLoad() }, { MatchScreen.UnloadButton, () => _Controllers[_CurrentTurn.TurnComponent].CanUnload() }, { MatchScreen.FortifyButton, () => _Controllers[_CurrentTurn.TurnComponent].CanFortify() }, { MatchScreen.AbandonButton, () => _Controllers[_CurrentTurn.TurnComponent].CanAbandon() }, { MatchScreen.DismountButton, () => _Controllers[_CurrentTurn.TurnComponent].CanDismount() }, { MatchScreen.MountButton, () => _Controllers[_CurrentTurn.TurnComponent].CanMount() }, { MatchScreen.EvacuateButton, () => _Controllers[_CurrentTurn.TurnComponent].CanEvacuate() }, { MatchScreen.ReconButton, () => _Controllers[_CurrentTurn.TurnComponent].CanRecon() }, { MatchScreen.ClearMinefieldButton, () => _Controllers[_CurrentTurn.TurnComponent].CanClearMinefield() }, { MatchScreen.EmplaceButton, () => _Controllers[_CurrentTurn.TurnComponent].CanEmplace() } }; }
public MatchRecordReplayPlayerController(MatchAdapter Match, MatchRecord MatchRecord) { _Match = Match; _Orders = new Queue <Order>(MatchRecord.Orders); }
public AIMatchPlayerController(MatchAdapter Match, Army Army) { this.Match = Match; this.Army = Army; Root = new AIRoot(Match, Army); }