public ApplicationViewModel() { _serverModel = new ServerModel(); _serverVM = new ServerViewModel(_serverModel); //_serverVM.StartCommand = new DelegateCommand(OnStart); _playManagerModel = new PlayManagerModel(_serverModel); _playManagerVM = new PlayManagerViewModel(_playManagerModel, _serverModel); _serverModel.ServerStarted += _server_started; CurrentViewModel = _serverVM; }
public PlayManagerViewModel(PlayManagerModel pm, ServerModel sm) { _serverModel = sm; _playManagerModel = pm; _serverModel.PlayerJoined += _serverModel_PlayerJoined; _serverModel.PlayerLeft += _serverModel_PlayerLeft;; PlayerList = new ObservableCollection <PlayerInfo>(); NumMafias = 2; HasDetective = true; HasDoctor = true; HasJoker = true; // for testing //PlayerList.Add(new PlayerInfo() { Name = "Anjali" }); //PlayerList.Add(new PlayerInfo() { Name = "Abhilash" }); //PlayerList.Add(new PlayerInfo() { Name = "Augustus" }); //PlayerList.Add(new PlayerInfo() { Name = "Chayanika" }); //PlayerList.Add(new PlayerInfo() { Name = "Karishma" }); //PlayerList.Add(new PlayerInfo() { Name = "Rhea" }); //PlayerList.Add(new PlayerInfo() { Name = "Reshmi" }); PlayCommand = new DelegateCommand(OnPlay); }