public SaveSessionPage(PlaySession session, GameSeason currentSeason) { InitializeComponent(); BindingContext = viewModel = new SaveSessionViewModel(session, currentSeason); SessionSkillRating.ReturnCommand = new Command(() => Button_OnClicked(SessionSkillRating, EventArgs.Empty)); }
public void SetSeason() { GameSeason season = this.Season; if (this.Month >= 3 && this.Month <= 5) { this.Season = GameSeason.春; } else if (this.Month >= 6 && this.Month <= 8) { this.Season = GameSeason.夏; } else if (this.Month >= 9 && this.Month <= 11) { this.Season = GameSeason.秋; } else { this.Season = GameSeason.冬; } if ((season != this.Season) && (this.OnSeasonChange != null)) { this.OnSeasonChange(this.Season); } //*jokosany每个月重新随机选择一首背景音乐,必须放在this.SetSeason();之后 //Session.MainGame.mainGameScreen.SwichMusic(Session.Current.Scenario.Date.Season); // Session.MainGame.mainGameScreen.SwichMusic(GameSeason.秋); // Session.MainGame.mainGameScreen.SwichMusic(this.Season); }
private void Date_OnSeasonChange(GameSeason season) { switch (season) { case GameSeason.春: this.PlayMusic("GameMusic/Spring.wma"); break; case GameSeason.夏: this.PlayMusic("GameMusic/Summer.wma"); break; case GameSeason.秋: this.PlayMusic("GameMusic/Autumn.wma"); break; case GameSeason.冬: this.PlayMusic("GameMusic/Winter.wma"); break; } if (!base.Scenario.Threading && base.Scenario.Date.Day == 1) { base.Scenario.SeasonChangeEvent(); } }
public CurrentSessionPage(GameSeason currentSeason) { InitializeComponent(); BindingContext = viewModel = new CurrentSessionViewModel(currentSeason); viewModel.StartNewSession(); }
public void SetSeason() { GameSeason season = this.Season; if (this.Month >= 3 && this.Month <= 5) { this.Season = GameSeason.春; } else if (this.Month >= 6 && this.Month <= 8) { this.Season = GameSeason.夏; } else if (this.Month >= 9 && this.Month <= 11) { this.Season = GameSeason.秋; } else { this.Season = GameSeason.冬; } if ((season != this.Season) && (this.OnSeasonChange != null)) { this.OnSeasonChange(this.Season); } }
private void Date_OnSeasonChange(GameSeason season) { switch (season) { case GameSeason.春: this.PlayMusic("GameMusic/Spring.mp3"); break; case GameSeason.夏: this.PlayMusic("GameMusic/Summer.mp3"); break; case GameSeason.秋: this.PlayMusic("GameMusic/Autumn.mp3"); break; case GameSeason.冬: this.PlayMusic("GameMusic/Winter.mp3"); break; } if (!base.Scenario.Threading&&base.Scenario.Date.Day==1) { base.Scenario.SeasonChangeEvent(); } }
private void Date_OnSeasonChange(GameSeason season) { if (this.Scenario.CurrentPlayer == null || this.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.和平) { this.SwichMusic(season); } if (!base.Scenario.Threading && base.Scenario.Date.Day == 1) { base.Scenario.SeasonChangeEvent(); } }
public CurrentSessionViewModel(GameSeason currentSeason) { PlaySession = new PlaySession(); streak = new StreakController(); Title = "Today"; CurrentGameSeason = currentSeason; HighestSkillRating = CurrentGameSeason.HighestSkillRating; LastSkillRating = CurrentGameSeason.LastSkillRating; StartNewSession(); }
private void Date_OnSeasonChange(GameSeason season) { if (Session.Current.Scenario.CurrentPlayer == null || Session.Current.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.和平) { this.SwichMusic(season); } if (!Session.Current.Scenario.Threading && Session.Current.Scenario.Date.Day <= Session.Current.Scenario.Parameters.DayInTurn) { Session.Current.Scenario.SeasonChangeEvent(); } }
public GameDate PlusSeasons(int SeasonsToAdd) { GameSeason s = Season; while (SeasonsToAdd > 0) { s = GetNextSeason(s); SeasonsToAdd--; } while (SeasonsToAdd < 0) { s = GetLastSeason(s); SeasonsToAdd++; } return(new GameDate(s, Day)); }
public static GameSeason GetNextSeason(GameSeason season) { if (season == GameSeason.SUMMER) { return(GameSeason.FALL); } if (season == GameSeason.FALL) { return(GameSeason.WINTER); } if (season == GameSeason.WINTER) { return(GameSeason.SPRING); } return(GameSeason.SUMMER); }
public GameDate PlusDays(int DaysToAdd) { int newDay = Day + DaysToAdd; GameSeason gameSeason = Season; while (newDay > 28) { gameSeason = GetNextSeason(gameSeason); newDay -= 28; } while (newDay < 1) { newDay += 28; gameSeason = GetLastSeason(gameSeason); } return(new GameDate(gameSeason, newDay)); }
public float GetFoodRateBySeason(GameSeason season) { switch (season) { case GameSeason.春: return 0.6f; case GameSeason.夏: return 1f; case GameSeason.秋: return 1f; case GameSeason.冬: return 0.3f; } return 0f; }
public float GetFoodRateBySeason(GameSeason season) { switch (season) { case GameSeason.春: return(0.6f); case GameSeason.夏: return(1f); case GameSeason.秋: return(1f); case GameSeason.冬: return(0.3f); } return(0f); }
public async Task <Maybe <GameSeason> > LastUsedSeason() { if (_currentGameSeason == null) { var stateValue = await _database.GetAppStateValue(UserDataTable.LAST_USED_SEASON); if (stateValue != null) { _currentGameSeason = await _database.GetSeasonById(int.Parse(stateValue.Value)); } } if (_currentGameSeason == null) { return(new Maybe <GameSeason>()); } return(new Maybe <GameSeason>(_currentGameSeason)); }
public int GetFood(GameSeason season) { int foodDeposit = this.foodDeposit; switch (season) { case GameSeason.春: return (int) (foodDeposit * this.FoodSpringRate); case GameSeason.夏: return (int) (foodDeposit * this.FoodSummerRate); case GameSeason.秋: return (int) (foodDeposit * this.FoodAutumnRate); case GameSeason.冬: return (int) (foodDeposit * this.FoodWinterRate); } return foodDeposit; }
public int GetRandomFood(GameSeason season) { int num = GameObject.Random(this.FoodDeposit / 2) + ((this.FoodDeposit * 3) / 4); switch (season) { case GameSeason.春: return (int) (num * this.FoodSpringRate); case GameSeason.夏: return (int) (num * this.FoodSummerRate); case GameSeason.秋: return (int) (num * this.FoodAutumnRate); case GameSeason.冬: return (int) (num * this.FoodWinterRate); } return num; }
public int GetFood(GameSeason season) { int foodDeposit = this.foodDeposit; switch (season) { case GameSeason.春: return((int)(foodDeposit * this.FoodSpringRate)); case GameSeason.夏: return((int)(foodDeposit * this.FoodSummerRate)); case GameSeason.秋: return((int)(foodDeposit * this.FoodAutumnRate)); case GameSeason.冬: return((int)(foodDeposit * this.FoodWinterRate)); } return(foodDeposit); }
public int GetRandomFood(GameSeason season) { int num = GameObject.Random(this.FoodDeposit / 2) + ((this.FoodDeposit * 3) / 4); switch (season) { case GameSeason.春: return((int)(num * this.FoodSpringRate)); case GameSeason.夏: return((int)(num * this.FoodSummerRate)); case GameSeason.秋: return((int)(num * this.FoodAutumnRate)); case GameSeason.冬: return((int)(num * this.FoodWinterRate)); } return(num); }
public override void SwichMusic(GameSeason season) { if (this.Scenario.CurrentPlayer!=null && this.Scenario.CurrentPlayer.BattleState!=ZhandouZhuangtai.和平) { if (this.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.进攻) { this.PlayMusic("GameMusic/Attack.wma"); } else if (this.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.防守) { this.PlayMusic("GameMusic/Defend.wma"); } else { this.PlayMusic("GameMusic/Battle.wma"); } } else { switch (season) { case GameSeason.春: this.PlayMusic("GameMusic/Spring.wma"); break; case GameSeason.夏: this.PlayMusic("GameMusic/Summer.wma"); break; case GameSeason.秋: this.PlayMusic("GameMusic/Autumn.wma"); break; case GameSeason.冬: this.PlayMusic("GameMusic/Winter.wma"); break; } } }
public override void SwichMusic(GameSeason season) { if (this.Scenario.CurrentPlayer != null && this.Scenario.CurrentPlayer.BattleState != ZhandouZhuangtai.和平) { if (this.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.进攻) { this.PlayMusic("GameMusic/Attack.wma"); } else if (this.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.防守) { this.PlayMusic("GameMusic/Defend.wma"); } else { this.PlayMusic("GameMusic/Battle.wma"); } } else { switch (season) { case GameSeason.春: this.PlayMusic("GameMusic/Spring.wma"); break; case GameSeason.夏: this.PlayMusic("GameMusic/Summer.wma"); break; case GameSeason.秋: this.PlayMusic("GameMusic/Autumn.wma"); break; case GameSeason.冬: this.PlayMusic("GameMusic/Winter.wma"); break; } } }
public Task UpdateGameSeason(GameSeason editingGameSeason) { return(_database.UpdateWithChildrenAsync(editingGameSeason)); }
public Task AddPlaySession(GameSeason season, PlaySession playSession) { season.SessionHistory.Add(playSession); _database.InsertWithChildrenAsync(playSession); return(UpdateGameSeason(season)); }
public async Task SetLastUsedSeason(GameSeason season) { _currentGameSeason = season; await _database.SetAppStateValue(UserDataTable.LAST_USED_SEASON, season.Id.ToString()); }
public void SetSeason() { GameSeason season = this.Season; if (this.Month >= 3 && this.Month<=5) { this.Season = GameSeason.春; } else if (this.Month >= 6 && this.Month <= 8) { this.Season = GameSeason.夏; } else if (this.Month >= 9 && this.Month <= 11) { this.Season = GameSeason.秋; } else { this.Season = GameSeason.冬; } if ((season != this.Season) && (this.OnSeasonChange != null)) { this.OnSeasonChange(this.Season); } }
public override void SwichMusic(GameSeason season) { if (Session.GlobalVariables.PlayMusic) { try { if (Session.Current.Scenario.CurrentPlayer != null && Session.Current.Scenario.CurrentPlayer.BattleState != ZhandouZhuangtai.和平) { if (Session.Current.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.进攻) { Session.PlayMusic("Attack"); //Player.currentPlaylist.clear(); //WMPLib.IWMPMedia media5; //string[] filePaths5 = Directory.GetFiles("GameMusic/Attack/", "*.mp3"); //int index5 = GameObject.Random(filePaths5.Length); //string path5 = filePaths5[index5]; //foreach (String s in filePaths5) //{ // media5 = Player.newMedia(s); // Player.currentPlaylist.appendItem(media5); //} //media5 = Player.newMedia(path5); //Player.currentPlaylist.appendItem(media5); //Player.currentItem = media5; //Player.play(); //Player.settings.setMode("loop", true); //this.PlayMusic("GameMusic/Attack.mp3"); } else if (Session.Current.Scenario.CurrentPlayer.BattleState == ZhandouZhuangtai.防守) { Session.PlayMusic("Defend"); //Player.currentPlaylist.clear(); //WMPLib.IWMPMedia media6; //string[] filePaths6 = Directory.GetFiles("GameMusic/Defend/", "*.mp3"); //int index6 = GameObject.Random(filePaths6.Length); //string path6 = filePaths6[index6]; //foreach (String s in filePaths6) //{ // media6 = Player.newMedia(s); // Player.currentPlaylist.appendItem(media6); //} //media6 = Player.newMedia(path6); //Player.currentPlaylist.appendItem(media6); //Player.currentItem = media6; //Player.play(); //Player.settings.setMode("loop", true); // this.PlayMusic("GameMusic/Defend.mp3"); } else { Session.PlayMusic("Battle"); //Player.currentPlaylist.clear(); //WMPLib.IWMPMedia media7; //string[] filePaths7 = Directory.GetFiles("GameMusic/Battle/", "*.mp3"); //int index7 = GameObject.Random(filePaths7.Length); //string path7 = filePaths7[index7]; //foreach (String s in filePaths7) //{ // media7 = Player.newMedia(s); // Player.currentPlaylist.appendItem(media7); //} //media7 = Player.newMedia(path7); //Player.currentPlaylist.appendItem(media7); //Player.currentItem = media7; //Player.play(); //Player.settings.setMode("loop", true); //this.PlayMusic("GameMusic/Battle.mp3"); } } else { switch (season) { case GameSeason.春: Session.PlayMusic("Spring"); //Player.currentPlaylist.clear(); //WMPLib.IWMPMedia media; //string[] filePaths = Directory.GetFiles("GameMusic/Spring/", "*.mp3"); //int index = GameObject.Random(filePaths.Length); //string path = filePaths[index]; //foreach (String s in filePaths) //{ // media = Player.newMedia(s); // Player.currentPlaylist.appendItem(media); //} //media = Player.newMedia(path); //Player.currentPlaylist.appendItem(media); //Player.currentItem = media; //Player.play(); //Player.settings.setMode("loop", true); //this.PlayMusic("GameMusic/Spring.mp3"); break; case GameSeason.夏: Session.PlayMusic("Summer"); //Player.currentPlaylist.clear(); //WMPLib.IWMPMedia media2; //string[] filePaths2 = Directory.GetFiles("GameMusic/Summer/", "*.mp3"); //int index2 = GameObject.Random(filePaths2.Length); //string path2 = filePaths2[index2]; //foreach (String s in filePaths2) //{ // media2 = Player.newMedia(s); // Player.currentPlaylist.appendItem(media2); //} //media2 = Player.newMedia(path2); //Player.currentPlaylist.appendItem(media2); //Player.currentItem = media2; //Player.play(); //Player.settings.setMode("loop", true); // this.PlayMusic("GameMusic/Summer.mp3"); break; case GameSeason.秋: Session.PlayMusic("Autumn"); //Player.currentPlaylist.clear(); //WMPLib.IWMPMedia media3; //string[] filePaths3 = Directory.GetFiles("GameMusic/Autumn/", "*.mp3"); //int index3 = GameObject.Random(filePaths3.Length); //string path3 = filePaths3[index3]; //foreach (String s in filePaths3) //{ // media3 = Player.newMedia(s); // Player.currentPlaylist.appendItem(media3); //} //media3 = Player.newMedia(path3); //Player.currentPlaylist.appendItem(media3); //Player.currentItem = media3; //Player.play(); //Player.settings.setMode("loop", true); //this.PlayMusic("GameMusic/Autumn.mp3"); break; case GameSeason.冬: Session.PlayMusic("Winter"); //Player.currentPlaylist.clear(); //WMPLib.IWMPMedia media4; //string[] filePaths4 = Directory.GetFiles("GameMusic/Winter/", "*.mp3"); //int index4 = GameObject.Random(filePaths4.Length); //string path4 = filePaths4[index4]; //foreach (String s in filePaths4) //{ // media4 = Player.newMedia(s); // Player.currentPlaylist.appendItem(media4); //} //media4 = Player.newMedia(path4); //Player.currentPlaylist.appendItem(media4); //Player.currentItem = media4; //Player.play(); //Player.settings.setMode("loop", true); //this.PlayMusic("GameMusic/Winter.mp3"); break; } } } catch (System.Runtime.InteropServices.COMException) { } } else { Session.StopSong(); //this.StopMusic(); } }
public EditGameSeasonViewModel(GameSeason season) { EditingGameSeason = season ?? new GameSeason(); }
public EditGameSeasonPage(GameSeason season = null) { InitializeComponent(); BindingContext = viewModel = new EditGameSeasonViewModel(season); }
public GameDate(GameSeason season, int day) { Season = season; Day = day; }
public Task AddGameSeason(GameSeason newSeason) { return(_database.InsertWithChildrenAsync(newSeason)); }
public async void SelectGameSeason(GameSeason item) { await Database.User.SetLastUsedSeason(item); }
private void Date_OnSeasonChange(GameSeason season) { if (this.Scenario.CurrentPlayer == null || this.Scenario.CurrentPlayer.BattleState==ZhandouZhuangtai.和平) { this.SwichMusic(season); } if (!base.Scenario.Threading&&base.Scenario.Date.Day==1) { base.Scenario.SeasonChangeEvent(); } }
public virtual void SwichMusic(GameSeason season) { }
public GameDateChange(int Year, GameSeason season) { this.Year = Year; this.Season = season; }
private void Date_OnSeasonChange(GameSeason season) { switch (season) { case GameSeason.春: this.PlayMusic("GameMusic/Spring.wma"); break; case GameSeason.夏: this.PlayMusic("GameMusic/Summer.wma"); break; case GameSeason.秋: this.PlayMusic("GameMusic/Autumn.wma"); break; case GameSeason.冬: this.PlayMusic("GameMusic/Winter.wma"); break; } }
public SaveSessionViewModel(PlaySession session, GameSeason currentSeason) { playsession = session; this.currentSeason = currentSeason; SaveLastPlaySessionCommand = new Command(async(param) => await ExecuteSaveLastPlaySessionCommand((SaveParams)param)); }