コード例 #1
0
        public SaveSessionPage(PlaySession session, GameSeason currentSeason)
        {
            InitializeComponent();

            BindingContext = viewModel = new SaveSessionViewModel(session, currentSeason);
            SessionSkillRating.ReturnCommand = new Command(() => Button_OnClicked(SessionSkillRating, EventArgs.Empty));
        }
コード例 #2
0
ファイル: GameDate.cs プロジェクト: parhelia512/ZHSan
        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);
        }
コード例 #3
0
ファイル: MGSDate.cs プロジェクト: simon217/ZhongHuaSanGuoZhi
        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();
            }
        }
コード例 #4
0
        public CurrentSessionPage(GameSeason currentSeason)
        {
            InitializeComponent();

            BindingContext = viewModel = new CurrentSessionViewModel(currentSeason);
            viewModel.StartNewSession();
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
ファイル: MGSDate.cs プロジェクト: skicean/ZhongHuaSanGuoZhi
        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();
                
            }
        }
コード例 #7
0
ファイル: MGSDate.cs プロジェクト: simon217/ZhongHuaSanGuoZhi
 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();
     }
 }
コード例 #8
0
        public CurrentSessionViewModel(GameSeason currentSeason)
        {
            PlaySession        = new PlaySession();
            streak             = new StreakController();
            Title              = "Today";
            CurrentGameSeason  = currentSeason;
            HighestSkillRating = CurrentGameSeason.HighestSkillRating;
            LastSkillRating    = CurrentGameSeason.LastSkillRating;

            StartNewSession();
        }
コード例 #9
0
 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();
     }
 }
コード例 #10
0
        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));
        }
コード例 #11
0
 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);
 }
コード例 #12
0
        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));
        }
コード例 #13
0
ファイル: GameDate.cs プロジェクト: skicean/ZhongHuaSanGuoZhi
        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;
        }
コード例 #14
0
        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);
        }
コード例 #15
0
            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));
            }
コード例 #16
0
        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;
        }
コード例 #17
0
        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;
        }
コード例 #18
0
ファイル: TerrainDetail.cs プロジェクト: zhaohuwei/ZHSan
        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);
        }
コード例 #19
0
ファイル: TerrainDetail.cs プロジェクト: zhaohuwei/ZHSan
        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);
        }
コード例 #20
0
ファイル: MGSDate.cs プロジェクト: simon217/ZhongHuaSanGuoZhi
        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;
                }
            }
        }
コード例 #21
0
ファイル: MGSDate.cs プロジェクト: simon217/ZhongHuaSanGuoZhi
        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;
                }
            }
        }
コード例 #22
0
 public Task UpdateGameSeason(GameSeason editingGameSeason)
 {
     return(_database.UpdateWithChildrenAsync(editingGameSeason));
 }
コード例 #23
0
 public Task AddPlaySession(GameSeason season, PlaySession playSession)
 {
     season.SessionHistory.Add(playSession);
     _database.InsertWithChildrenAsync(playSession);
     return(UpdateGameSeason(season));
 }
コード例 #24
0
 public async Task SetLastUsedSeason(GameSeason season)
 {
     _currentGameSeason = season;
     await _database.SetAppStateValue(UserDataTable.LAST_USED_SEASON, season.Id.ToString());
 }
コード例 #25
0
ファイル: GameDate.cs プロジェクト: skicean/ZhongHuaSanGuoZhi
 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);
     }
 }
コード例 #26
0
        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();
            }
        }
コード例 #27
0
 public EditGameSeasonViewModel(GameSeason season)
 {
     EditingGameSeason = season ?? new GameSeason();
 }
コード例 #28
0
        public EditGameSeasonPage(GameSeason season = null)
        {
            InitializeComponent();

            BindingContext = viewModel = new EditGameSeasonViewModel(season);
        }
コード例 #29
0
 public GameDate(GameSeason season, int day)
 {
     Season = season;
     Day    = day;
 }
コード例 #30
0
 public Task AddGameSeason(GameSeason newSeason)
 {
     return(_database.InsertWithChildrenAsync(newSeason));
 }
コード例 #31
0
 public async void SelectGameSeason(GameSeason item)
 {
     await Database.User.SetLastUsedSeason(item);
 }
コード例 #32
0
ファイル: MGSDate.cs プロジェクト: simon217/ZhongHuaSanGuoZhi
        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();

            }
        }
コード例 #33
0
 public virtual void SwichMusic(GameSeason season)
 {
 }
コード例 #34
0
ファイル: Changes.cs プロジェクト: jaenudin86/dwarrowdelf
 public GameDateChange(int Year, GameSeason season)
 {
     this.Year   = Year;
     this.Season = season;
 }
コード例 #35
0
ファイル: Changes.cs プロジェクト: Fulborg/dwarrowdelf
 public GameDateChange(int Year, GameSeason season)
 {
     this.Year = Year;
     this.Season = season;
 }
コード例 #36
0
        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;
            }
        }
コード例 #37
0
 public virtual void SwichMusic(GameSeason season)
 {
 }
コード例 #38
0
 public SaveSessionViewModel(PlaySession session, GameSeason currentSeason)
 {
     playsession                = session;
     this.currentSeason         = currentSeason;
     SaveLastPlaySessionCommand = new Command(async(param) => await ExecuteSaveLastPlaySessionCommand((SaveParams)param));
 }