示例#1
0
        private MissionModel GetModel(Data.MissionData data, IMission item)
        {
            var model = new MissionModel();

            model.Id   = item.GetType().FullName;
            model.Name = item.Name;
            if (item.IsStopping())
            {
                model.State = MissionRunState.Stopping;
            }
            else if (item.IsRunning())
            {
                model.State = MissionRunState.Running;
            }
            else
            {
                model.State = MissionRunState.Stoped;
            }
            model.Inner = item.IsExecuting() ? MissionExecuteState.Busy : MissionExecuteState.Idle;

            var value = GetValue(item, data);

            model.Type    = value.Type;
            model.Seconds = value.Seconds;
            return(model);
        }
示例#2
0
    public void SetMission(MissionModel left)
    {
        var finding = Icon.Find(left.gemID.ToString());

        if (finding != null && image == null)
        {
            image = finding.GetComponent <Image>();
            image.gameObject.SetActive(true);

            squash = DOTween.Sequence();
            squash.OnStart(() => image.rectTransform.localScale = Vector3.one);
            squash.Append(image.rectTransform.DOScale(new Vector3(1.08f, 0.92f, 1), 0.24f));
            squash.Append(image.rectTransform.DOScale(Vector3.one, 1.36f).SetEase(Ease.OutElastic));
            squash.SetAutoKill(false);
            squash.Pause();
        }

        if (countLeft > left.howMany)
        {
            countTarget = left.howMany;
            squash.Restart();

            if (chainging == null)
            {
                chainging = StartCoroutine(StartTextChanging());
            }
        }
        else if (countLeft < left.howMany)
        {
            var sb = new StringBuilder();
            sb.AppendFormat("{0}", left.howMany);
            label.text = sb.ToString();
            countLeft  = left.howMany;
        }
    }
示例#3
0
        // GET: Mission/Delete/5
        public async Task <ActionResult> DeleteAsync(int id)
        {
            MissionModel mission = await _missionService.GetAsync(HttpContext.Session, id);

            ViewData.Model = mission;
            return(View());
        }
示例#4
0
//	public void SetView()
//	{

//	}

        public void SetData(MissionModel missionModel)
        {
            for (int i = 0; i < _btnGroup.childCount; i++)
            {
                Transform roleStory = _btnGroup.GetChild(i);
                Text      nameText  = roleStory.Find("NumBottom/Text").GetComponent <Text>();
                var       roleId    = (PlayerPB)(i);
                //var vo = missionModel.GetPlayerName(roleId);
                //RedPoint
                roleStory.Find("RedPoint").gameObject.SetActive(missionModel.HasReceiveChievement(roleId));

                if (missionModel.StarCourseSchedule.ContainsKey(roleId))
                {
                    nameText.text = I18NManager.Get("Achievement_LongKM",
                                                    missionModel.StarCourseSchedule[roleId]
                                                    .Progress);     //"里程:"+missionModel.StarCourseSchedule[roleId].Progress+"km";
                }
                else
                {
                    nameText.text = I18NManager.Get("Achievement_LongKM", 0);
                }

                var role = i;
                PointerClickListener.Get(_btnGroup.GetChild(i).gameObject).onClick = go =>
                {
                    SendMessage(new Message(MessageConst.CMD_CHOOSEROLE, role));
                };
            }
        }
 public override void Start()
 {
     //获取用户任务的数据源
     //  _missionModel = GetData<MissionModel>();
     _missionModel = GlobalData.MissionModel;
     GetData();
 }
示例#6
0
        private void _UpdateMission()
        {
            _mission_dic = new Dictionary <int, List <MissionModel> >();
            Api_Result <List <User_MissionFmt> > api_Result = new Api_get_Member().Mission();

            if (api_Result.state != 0)
            {
                return;
            }
            DeckModel[] decksFromArea = base.UserInfo.GetDecksFromArea(_area_id);
            Dictionary <int, DeckModel> dictionary = new Dictionary <int, DeckModel>();

            foreach (DeckModel deckModel in decksFromArea)
            {
                if (deckModel.MissionState != 0)
                {
                    dictionary.Add(deckModel.MissionId, deckModel);
                }
            }
            for (int j = 0; j < api_Result.data.Count; j++)
            {
                User_MissionFmt user_MissionFmt = api_Result.data[j];
                MissionModel    missionModel    = (!dictionary.ContainsKey(user_MissionFmt.MissionId)) ? new MissionModel(user_MissionFmt) : new MissionModel(user_MissionFmt, dictionary[user_MissionFmt.MissionId]);
                if (!_mission_dic.ContainsKey(missionModel.AreaId))
                {
                    _mission_dic[missionModel.AreaId] = new List <MissionModel>();
                }
                _mission_dic[missionModel.AreaId].Add(missionModel);
            }
        }
示例#7
0
 private void OnGetMissionRule(MissionModel model)
 {
     _missionModel = model;
     _missionModel.UserMissionList.Sort();
     View.SetMissionItemData(_missionModel);
     View.ChangeViewState(curMissionTypePb); //默认日常任务的UI
 }
示例#8
0
 protected override void ReleaseReferences()
 {
     _application = null;
     _button      = null;
     model        = null;
     missionIdTxt = null;
 }
示例#9
0
        // GET: Mission/Edit/5
        public ActionResult Edit(int id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            mission      m  = ms.GetById(id);
            MissionModel M1 = new MissionModel()
            {
                M_TITLE       = m.M_TITLE,
                notes         = m.notes,
                M_DESCRIPTION = m.M_DESCRIPTION,
                DATE_DEB      = m.DATE_DEB,
                DATE_FIN      = m.DATE_FIN,
                manager_U_ID  = m.manager_U_ID,
            };

            if (m == null)
            {
                return(HttpNotFound());
            }

            ViewBag.manager_U_ID = new SelectList(es.GetAll(), "U_ID", "U_FirstName");
            return(View(M1));
        }
示例#10
0
        public ActionResult <ApiResponse <MissionModel> > CreateMission([FromBody] CreateMissionModel model)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(model.Name))
                {
                    return(Json(ApiResponse <MissionModel> .WithError("Name is required")));
                }

                var onlineUser = this._userService.GetOnlineUser(this.HttpContext);

                if (onlineUser == null)
                {
                    return(Json(ApiResponse.WithError("Not Authority")));
                }

                MissionModel result = null;

                var newMission = new Mission();
                newMission.Name   = model.Name;
                newMission.UserId = onlineUser.Id;

                this._missionService.AddNewMission(newMission);
                result = _missionService.GetById(newMission.Id);

                return(Json(ApiResponse <MissionModel> .WithSuccess(result)));
            }
            catch (Exception exp)
            {
                return(Json(ApiResponse <MissionModel> .WithError(exp.ToString())));
            }
        }
示例#11
0
        public static Mission ToMission(this MissionModel model)
        {
            Mission mission = null;

            if (model.GetType() == typeof(NewObservationMissionModel))
            {
                mission = ((NewObservationMissionModel)model).ToNewObersationMission();
            }
            else if (model.GetType() == typeof(VerificationMissionModel))
            {
                mission = ((VerificationMissionModel)model).ToVerificationMission();
            }
            else if (model.GetType() == typeof(IdentificationMissionModel))
            {
                mission = ((IdentificationMissionModel)model).ToIdentificationMission();
            }

            mission.Id              = model.Id;
            mission.Title           = model.Title;
            mission.Description     = model.Description;
            mission.EndingCondition = model.EndingCondition?.ToEndingCondition();
            mission.RestrictedArea  = model.RestrictedArea?.ToRestrictedArea();

            return(mission);
        }
 private void OnGetMissionRule(MissionModel model)
 {
     GlobalData.MissionModel = model;
     _missionModel           = GlobalData.MissionModel;
     View.SetData(_missionModel, _missionModel.PlayerBirthdayMissionsDay);
     CheckRefresh();
 }
示例#13
0
    public void readyForBattle()
    {
        _curRound   = -1;
        _actionTime = 0;
        _isWin      = false;

        _star  = 0;
        _score = 0;

        _gold  = 0;
        _paper = 0;

        SolaEngine engine = SolaEngine.getInstance();
        PartnerMgr pMgr   = (PartnerMgr)engine.getMgr(typeof(PartnerMgr));

        _partners = new Dictionary <int, BattleHeroModel> ();
        Dictionary <int, HeroModel> partner = pMgr.getPartners();

        foreach (int pos in partner.Keys)
        {
            HeroModel       model   = partner[pos];
            BattleHeroModel bhModel = new BattleHeroModel();
            bhModel.setModel(model, false, new Vector3(0, 0, 0));
            bhModel.formatModel();

            _partners.Add(pos, bhModel);
            bhModel.HERO_DIED += _onPartnerDeath;
        }

        MissionModel missionModel = _missionModel;

        _curBattleInfos = missionModel.getBattleInfos();
    }
    public void Initialize(DeckModel deckModel, MissionModel missionModel, int hasTankerCount)
    {
        mLabel_Message.alpha    = 0.01f;
        MissionStartTargetModel = missionModel;
        MissionStartDeckModel   = deckModel;
        mHasTankerCount         = hasTankerCount;
        List <UIButton> list = new List <UIButton>();

        list.Add(mButton_Negative);
        if (missionModel.TankerMinCount <= hasTankerCount)
        {
            list.Add(mButton_Positive);
        }
        list.Add(mButton_Description);
        mSelectableButtons            = list.ToArray();
        mButtonManager.IndexChangeAct = delegate
        {
            UIButton uIButton = mButtonManager.GetFocusableButtons()[mButtonManager.nowForcusIndex];
            if (0 <= Array.IndexOf(mSelectableButtons, uIButton))
            {
                ChangeFocusButton(uIButton);
            }
        };
        if (mInitializeCoroutine != null)
        {
            StopCoroutine(mInitializeCoroutine);
            mInitializeCoroutine = null;
        }
        mInitializeCoroutine = StartCoroutine(InitailizeCoroutine(deckModel, missionModel, hasTankerCount, delegate
        {
            mInitializeCoroutine = null;
            CallBackAction(ActionType.Shown, this);
            Opend = true;
        }));
    }
示例#15
0
    //helper method to generate random mission by tier
    private MissionModel getRandomMission(int tier)
    {
        MissionModel mission         = new MissionModel();
        int          max             = missions.Length;
        var          selectedMission = missions[UnityEngine.Random.Range(0, max)];

        mission.type                       = selectedMission.type;
        mission.numberToAchive             = (int)(selectedMission.numberToAchive * 1.1 * tier);
        mission.enemyType                  = selectedMission.enemyType;
        mission.powerUpType                = selectedMission.powerUpType;
        mission.isFinished                 = false;
        mission.needToBeCompletedInOneGame = selectedMission.needToBeCompletedInOneGame;
        string inOneGame = mission.needToBeCompletedInOneGame ? " in one game!" : "!";

        if (mission.type == MissionType.killTypeOfEnemy)
        {
            mission.missionText = string.Format("Kill total of {0} {1}{2}", mission.numberToAchive, enemyTypeString[mission.enemyType], inOneGame);
        }
        if (mission.type == MissionType.takePowerUp)
        {
            mission.missionText = string.Format("Get total of {0} {1}{2}", mission.numberToAchive, powerUpTypeString[mission.powerUpType], inOneGame);
        }
        if (mission.type == MissionType.getScoreOf)
        {
            mission.missionText = string.Format("Get score of {0}{1}", string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                                                     "{0:0,0}", mission.numberToAchive), inOneGame);
        }
        if (mission.type == MissionType.survival)
        {
            //  TimeSpan time = TimeSpan.FromSeconds(mission.numberToAchive);
            string text = formatCountTimeString(mission.numberToAchive);
            mission.missionText = string.Format("Survive for {0} minutes!", text);
        }
        return(mission);
    }
示例#16
0
        public async Task <ActionResult> EditAsync(int id, FraisModel model, long?missionId)
        {
            try
            {
                FraisModel fees = await _fraisService.GetAsync(HttpContext.Session, id);

                if (!ModelState.IsValid)
                {
                    return(View());
                }
                MissionModel mission = await _missionService.GetAsync(HttpContext.Session, missionId);

                model.Id      = id;
                model.Mission = mission;
                model.User    = fees.User;
                string uniqueFileName = UploadedFile(model);
                model.Justificatif = uniqueFileName;

                await _fraisService.UpdateAsync(HttpContext.Session, model);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
示例#17
0
 public void StartMission(MissionModel missionModel)
 {
     this.RemoveDungeon(missionModel.Dungeon);
     this.ActiveMissions.Add(missionModel);
     this.OnDungeonManagerChanged?.Invoke();
     this.OccupiedHeroes.AddRange(missionModel.Heroes);
 }
 public override void Start()
 {
     //获取用户任务的数据源
     _missionModel = GetData <MissionModel>();
     ClientData.LoadItemDescData(null);
     ClientData.LoadSpecialItemDescData(null);
     EventDispatcher.AddEventListener <UserMissionVo>(EventConst.RecieveAchievementReward, ReceiveItemReward);
     EventDispatcher.AddEventListener <string>(EventConst.JumpToAchievementCMD, JumpToOtherView);
 }
示例#19
0
 public void EndMission(MissionModel missionModel)
 {
     this.ActiveMissions.Remove(missionModel);
     this.OnDungeonManagerChanged?.Invoke();
     foreach (var hero in missionModel.Heroes)
     {
         this.OccupiedHeroes.Remove(hero);
     }
 }
    private void ShowMissionWithTankerConfirmPopUp(MissionModel missionModel)
    {
        SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = false;
        mUIMissionScrollListParent.EnableTouchControl = false;
        UIMissionWithTankerConfirmPopUp component = Util.Instantiate(mPrefab_UIMissionWithTankerConfirmPopUp.gameObject, mModalCamera.gameObject).GetComponent <UIMissionWithTankerConfirmPopUp>();

        component.SetOnUIMissionWithTankerConfirmPopUpAction(UIMissionWithTankerConfirmPopUpAction);
        ChangeFocusKeyController(null);
        component.Initialize(mMissionManager.UserInfo.GetDeck(mDeckId), missionModel, mMissionManager.TankerCount);
    }
示例#21
0
        /// <summary>
        /// 用户任务数据主通道
        /// </summary>
        /// <param name="missionModel"></param>
        public void SetMissionItemData(MissionModel missionModel)
        {
            _missionModel = missionModel;
            _data         = _missionModel.GetMissionListByType(MissionTypePB.Daily);
            _weekData     = _missionModel.GetMissionListByType(MissionTypePB.WeekDaily);

            //在此处设置红点!
            _dailyredPiont.SetActive(_missionModel.HasDailyActivityAward(_data));
            _weekredPiont.SetActive(_missionModel.HasWeekActivityAward(_weekData));
        }
示例#22
0
        // GET: Mission/Edit/5
        public async Task <ActionResult> EditAsync(int id)
        {
            MissionModel mission = await _missionService.GetAsync(HttpContext.Session, id);

            ViewData.Model = mission;
            CompteModel        compte = _compteService.GetConnectedCompte(HttpContext.Session);
            List <ProjetModel> result = await _projetService.GetListProjectByManager(HttpContext.Session, compte.User.Id.GetValueOrDefault(0));

            ViewBag.listprojet = result ?? new List <ProjetModel>();
            return(View());
        }
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        public IList <MissionModel> List()
        {
            var result = new List <MissionModel>();

            foreach (var item in Missions)
            {
                MissionModel model = GetModel(item.Value);
                result.Add(model);
            }
            return(result);
        }
        public ActionResult Create(MissionModel m)
        {
            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri("http://localhost:9080/Advyteam-web/");

            // TODO: Add insert logic here
            client.PostAsJsonAsync <MissionModel>("api/missions?nomProj=test", m)
            .ContinueWith((postTask) => postTask.Result.ReasonPhrase.Equals("Created"));
            return(RedirectToAction("Index"));
        }
示例#25
0
//        private long _refreshTime;
//        private string refreshPoint = "6:00:00";

        public override void Start()
        {
            //获取用户任务的数据源
            EventDispatcher.AddEventListener <UserMissionVo>(EventConst.RecieveTaskReward, OnReceiveReward);
            EventDispatcher.AddEventListener(EventConst.BuyGoldSuccess, GetData);
            EventDispatcher.AddEventListener <string>(EventConst.JumpToCMD, JumpToOtherView);
            curMissionTypePb = MissionTypePB.Daily;
            _missionModel    = GlobalData.MissionModel;
            GetData();
            EventDispatcher.AddEventListener(EventConst.DailyRefresh6, RefershTask);
        }
示例#26
0
 public static Dictionary <string, object> ConvertMission(this MissionModel model)
 {
     return(new Dictionary <string, object>
     {
         { "MissionID", model.ID },
         { "TeacherID", model.TeacherID },
         { "StudentID", model.StudentID },
         { "Name", model.Name },
         { "IsFinish", model.IsFinished }
     });
 }
    private void ShowMissionWithTankerDescriptionPopUp(MissionModel model)
    {
        mUIMissionScrollListParent.EnableTouchControl = false;
        UIMissionWithTankerDescriptionPopUp component = Util.Instantiate(mPrefab_UIMissionWithTankerDescriptionPopUp.gameObject, mModalCamera.gameObject).GetComponent <UIMissionWithTankerDescriptionPopUp>();

        mModalCamera.Show();
        component.Initialize(model);
        component.SetOnUIMissionWithTankerDescriptionPopUpAction(UIMissionWithTankerDescriptionPopUpAction);
        component.Show();
        ChangeFocusKeyController(component.GetKeyController());
    }
示例#28
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        public IList <MissionModel> List()
        {
            var result = new List <MissionModel>();
            var source = new Application.Mission().List();

            foreach (var item in Missions)
            {
                MissionModel model = GetModel(source.FirstOrDefault(o => o.Id == item.Key), item.Value);
                result.Add(model);
            }
            return(result);
        }
示例#29
0
        public List <DateTime> GetMissionPeriods(MissionModel mission)
        {
            var startDt = mission.StartDate;
            var endDt   = mission.EndDate;

            var diff = Enumerable.Range(0, 13)
                       .Select(a => startDt.AddMonths(a))
                       .TakeWhile(a => a <= endDt)
                       .ToList();

            return(diff);
        }
示例#30
0
    public void SetData(UserMissionVo vo, MissionModel missionModel)
    {
        _data               = vo;
        _missionPb          = missionModel.GetMissionById(vo.MissionId);
        _titleNameText.text = _missionPb.MissionDesc;               //任务名称



        SetState();
        SetProgress();
        SetAwardData();
    }
示例#31
0
        public static MissionList LoadMissions(BinaryReader reader, int missionCount)
        {
            var missions = new MissionList();
            for (var i = 0; i < missionCount; i++)
            {
                var mission = new MissionModel();
                mission.Id = reader.ReadInt32();
                mission.Date = GetDateFromValue(reader.ReadInt32());
                mission.ClientName		= new string(reader.ReadChars(10)).TrimEnd();
                mission.RewardAmount	= reader.ReadInt16();
                mission.Type			= (MissionType)reader.ReadByte();
                mission.Difficulty		= (Difficulty)reader.ReadByte();
                mission.TargetStarSystem = Galaxy.StarSystems[reader.ReadByte(), reader.ReadByte()];
                switch (mission.Type)
                {
                    case MissionType.PackageDelivery:	mission.PackageDescription = new string(reader.ReadChars(20)).TrimEnd();	break;
                    case MissionType.GoodsDelivery	:	mission.GoodsToDeliver_Type = (Merchandise)reader.ReadByte();	mission.GoodsToDeliver_Amount = reader.ReadByte();	break;
                    case MissionType.Assassination	:	mission.AssassinationTarget = LoadNPC(reader);		break;
                }
                missions.Add(mission);
            }

            return missions;
        }