public PlayerListModel PlayerList() { var model = new PlayerListModel(); model.Players = Dependency.Resolve <IPlayerManager>().GetPlayers(null, null); return(model); }
public ActionResult AllPlayers() { PlayerListModel model = new PlayerListModel(); model.PlayerCount = 3; Player a = new Player(); a.Name = "Juan"; a.LastName = "Lopez"; a.Number = 23; a.College = "Stanford"; a.Age = 22; a.Position = 1; Player b = new Player(); b.Name = "Jose"; b.LastName = "Perez"; b.Number = 13; b.College = "Stanford"; b.Age = 21; b.Position = 2; Player[] players = new Player[2]; players[0] = a; players[1] = b; return(View(players)); }
#pragma warning restore 0414 private void Start() { _prototype.gameObject.SetActive(false); GameObject.DontDestroyOnLoad(this.gameObject); _factory = new PlayerViewFactory(_viewParent, _prototype); _model = new PlayerListModel(); _ctrl = new PlayerCtrl(_model, _factory); }
public PlayerListModel GetPlayerListModel(IEnumerable<PlayerModel> playerModels) { var playerListModel = new PlayerListModel { Items = playerModels != null ? playerModels.ToList() : new List<PlayerModel>() }; return playerListModel; }
private PlayerListModel GetListData() { var model = new PlayerListModel { PlayerList = _listPlayerQuery.Handle(new GetPlayerListQuery() { }) }; return(model); }
public PlayerCtrl(PlayerListModel model, PlayerViewFactory factory) { _model = model; _factory = factory; if (_model.Count == 0) { PlayerModel defaultPlayer = new PlayerModel() { Color = 0, Name = "Hooman", Team = 0, Type = PlayerTypeEnum.Human }; _model.Add(defaultPlayer); } _view = new List <IPlayerView>(_model.Count); for (int p = 0; p < _model.Count; ++p) { PlayerModel player = _model[p]; IPlayerView pview = _factory.CreateNewPlayer(); _view.Add(pview); Link(p, player, pview); } }
public static PlatformType ResolvePlatformFromPlayer(PlayerListModel player) { if (player == null) { return(PlatformType.NONE); } if (player.DiscordPlayer != null) { return(PlatformType.Discord); } if (player.TelegramPlayer != null) { return(PlatformType.Telegram); } if (player.KikPlayer != null) { return(PlatformType.Kik); } if (player.WebPlayer != null) { return(PlatformType.Web); } return(PlatformType.NONE); }