Example #1
0
        protected virtual StageInfo EnterStage()
        {
            var result = _client.GetXHR("http://astrum.amebagames.com/_/stage");
            var stage  = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage.initial, _client.ViewModel);
            _client.DelayShort();

            return(stage);
        }
Example #2
0
        private StageInfo ForwardTpStage()
        {
            var values = new Dictionary <string, object>
            {
                { "areaId", "recovery_tp" }
            };
            var result = _client.PostXHR("http://astrum.amebagames.com/_/stage/tp", values);
            var stage  = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage, _client.ViewModel);
            _client.DelayShort();

            return(stage);
        }
Example #3
0
        public StageInfo EnterBreedingStage()
        {
            var areaId = "breeding0001-1";
            //MapInfo map = BreedingMap();
            //var areaId = map.list[0]._id;

            var url    = string.Format("http://astrum.amebagames.com/_/breeding/stage?areaId={0}&eventId={1}", areaId, Uri.EscapeDataString(_client.ViewModel.BreedingEventId));
            var result = _client.GetXHR(url);

            var stage = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage.initial, _client.ViewModel);

            _client.DelayShort();
            return(stage);
        }
Example #4
0
        protected virtual StageInfo ForwardStage(string areaId)
        {
            var values = new Dictionary <string, object>
            {
                { "areaId", areaId }
            };
            var result = _client.PostXHR("http://astrum.amebagames.com/_/stage", values);
            var stage  = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);

            var feverBefore = _client.ViewModel.Fever;

            InfoUpdater.UpdateStageView(stage, _client.ViewModel);
            if (_client.ViewModel.Fever && feverBefore != _client.ViewModel.Fever)
            {
                _client.RaiseNotificationEvent("Fever start", AstrumClient.SECOND * 60);
            }

            _client.DelayShort();
            return(stage);
        }
Example #5
0
        protected override StageInfo EnterStage()
        {
            AreaInfo area = FindArea();

            var areaId = area._id;

            if (area.status == 1)
            {
                OpenStage(area);
            }

            var url    = string.Format("http://astrum.amebagames.com/_/stage?areaId={0}", areaId);
            var result = _client.GetXHR(url);

            var stage = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage.initial, _client.ViewModel);

            _client.DelayShort();
            return(stage);
        }