public void Setup() { chapter = DataManager.Get().ChapterData[1]; GameManager.Get().CurrentChapter = chapter; var stageJsonText = Resources.Load <TextAsset>("Data/Stage/Stage01"); stage = JObject.Parse(stageJsonText.text).ToObject <StageModel>(); var mapJsonText = Resources.Load <TextAsset>($"Data/Map/{stage.MapName}"); map = JObject.Parse(mapJsonText.text).ToObject <MapModel>(); GameManager.Get().CurrentStage = stage; GameManager.Get().GameRoom = GameRoomModel.GetSoloPlay(); SceneManager.LoadScene("GameScene"); }
public void EditorStageLoad() { if (string.IsNullOrEmpty(filename)) { Debug.LogWarning("Can't load stage. You must specify a filename!"); return; } testStage = StageDb.LoadStageFromFile(filename); StageModel.Loaded = testStage; Debug.Log($"Stage {testStage.Id} loaded!"); }
public void Initialize() { Transform = new Matrix[StageModel.Bones.Count]; StageModel.CopyAbsoluteBoneTransformsTo(Transform); for (int i = 0; i < boxNum; i++) { box = new BoundingBox[boxNum]; } box[0] = new BoundingBox(new Vector3(-800.0f, 0.0f, -800.0f), new Vector3(800.0f, 800.0f, -800.0f)); box[1] = new BoundingBox(new Vector3(800.0f, 0.0f, -800.0f), new Vector3(800.0f, 800.0f, 800.0f)); box[2] = new BoundingBox(new Vector3(-800.0f, 0.0f, 800.0f), new Vector3(800.0f, 800.0f, 800.0f)); box[3] = new BoundingBox(new Vector3(-800.0f, 0.0f, -800.0f), new Vector3(-800.0f, 800.0f, 800.0f)); }
/// <summary> /// Declare payer le paiement du stage et ajoute le membre au stage /// </summary> public static void PayerStage(ClubModel club,PaiementModel p) { if(p!=null) { SupprimerPaiement(club, p); // On supprime le piament des paiement en attente StageModel s = p.Nature as StageModel; if(s!=null) { s.Participants.Add(p.Payeur); // On ajoute le membre aux participants du stage StageService.ModifierStage(club, s); // on met le stage a jour } } }
/// <summary> /// Modifie le stage /// </summary> public static void ModifierStage(ClubModel club, StageModel s) { if (s != null) { foreach (StageModel stage in club.ListeDesStages()) { if (stage.Id == s.Id) { club.Evenements.Remove(stage); club.Evenements.Add(s); break; } } } }
public void Setup(StageModel stageModel) { if (stageModel != null) { emptyContent.SetActive(false); savedStageContent.SetActive(true); this.StageModel = stageModel; nameText.text = stageModel.StageName; lengthText.text = stageModel.GetTotalStageLength().ToString(); } else { emptyContent.SetActive(true); savedStageContent.SetActive(false); } }
public async Task <ActionResult> CreateNewStage(StageModel model) { if (ModelState.IsValid) { StageModel st = new StageModel { Id = Guid.NewGuid(), Name = model.Name }; _context.Stages.Add(st); _context.SaveChanges(); } return(View("Index")); }
private IEnumerator Coroutine(int id) { //すでにステージがあれば消す if (_nowStageNm != null) { AsyncOperation ope = SceneManager.UnloadSceneAsync(_nowStageNm); ope.allowSceneActivation = false; while (ope.progress < 0.9f) { yield return(null); } ope.allowSceneActivation = true; _nowStageController = null; } //ステージ情報モデルの取得 StageModel stageModel = _stageDataBase.GetStageById(id); _clearTime = stageModel.ClearTime; _nowStageNm = stageModel.StageNm; //ステージシーンの読み込み。 { AsyncOperation ope = SceneManager.LoadSceneAsync(stageModel.StageNm, LoadSceneMode.Additive); ope.allowSceneActivation = false; while (ope.progress < 0.9f) { yield return(null); } ope.allowSceneActivation = true; } //セットされるまで待つ while (_nowStageController == null) { yield return(null); } _nowStageController.Init(); CharacterPause(); //ステージスタート前処理 _gameUIController.GameUIBeforeStarEffectService.StartAsync(id.ToString()); yield return(null); }
private void UpdatePlay() { if (view.TilesController.isAllSameTile()) { view.CreateResultDialog(true); } StageModel stage = GameModel.StageData.Stages [GameModel.CurrentStage]; LevelModel level = stage.Levels [GameModel.CurrentLevel]; if (level.MaxChangeCount - view.TilesController.ChangeCount < 0) { view.CreateResultDialog(false); } view.Draw(GameModel); }
public void AddStage(StageModel stage) { using (var repo = _factory.GetStageRepo()) using (var srepo = _factory.GetStrategyRepo()) { /* * srepo.Update(new StrategyDTO() * { * Study_Id = stage.Strategy.Id, * Name = stage.Strategy.Name * });*/ repo.Create(new StageEntity() { Name = stage.Name, Description = stage.Description }); } }
public void LoadStage(StageModel newStageModel) { if (newStageModel == null) { return; } float bezierCurveFactor = 3.5f; if (stageModel != null) { bezierCurveFactor = stageModel.BezierCurveFactor; } stageModel = newStageModel; stageModel.BezierCurveFactor = bezierCurveFactor; stageModel.RefreshPointsRightAndLeft(); RefreshGeometry(); }
/// <summary> /// Retourne true si le membre a postuler pour le stage mais n'a pas encore payer /// </summary> public static bool VeutParticiper(ClubModel club, StageModel s, MembreModel m) { if (m != null) { List <PaiementModel> ListePaiementsEnAttenteDuMembre = PaiementService.PaiementMembre(club, m); foreach (PaiementModel p in ListePaiementsEnAttenteDuMembre) // On regarde si le membre à postuler pour le stage et doit le payer { if (p.Nature is StageModel) { StageModel stage = p.Nature as StageModel; if (stage.Id == s.Id) { return(true); } } } return(false); } return(false); }
public void UpdateStageDisplayUber(DateTime startTime, DateTime endTime, double maxDurationInMinutes) { double scale = maxDisplayWidth / maxDurationInMinutes; // Start by adding a stage for time between now and the first stage. if (startTime > DateTime.Now) { double scaledDurationInMinutes = scale * ((startTime - DateTime.Now).TotalMinutes); StageDisplays.Add(StageModel.Waiting((int)(scaledDurationInMinutes))); } // Add the single stage as this is a car trip. StageDisplays.Add(new StageModel("#E0E0E4", (int)(scale * (endTime - startTime).TotalMinutes))); // Finally add the extra space to fill the bar within the tile if the trip is short. if (StageDisplays.Sum(x => x.Width) < maxDisplayWidth) { StageDisplays.Add(StageModel.Waiting((int)maxDisplayWidth - StageDisplays.Sum(x => x.Width))); } }
/// <summary> /// Supprime le membre du club /// </summary> public static void SupprimerMembre(ClubModel club, MembreModel m) { if (club.Membres.Contains(m)) { club.Membres.Remove(m); foreach (PaiementModel p in PaiementService.PaiementMembre(club, m)) { PaiementService.SupprimerPaiement(club, p); } EquipeService.SupprimerJoueurEquipe(club, m); foreach (EvenementsModel evenement in EvenementsAuquelIlParticipe(club, m)) { if (evenement is StageModel) { StageModel stage = evenement as StageModel; stage.Participants.Remove(m); StageService.ModifierStage(club, stage); } } } }
private void btnEditStage_Click(object sender, EventArgs e) { int id = TextUtils.ToInt(gvStage.GetFocusedRowCellValue(colIDStage)); if (id == 0) { return; } prevRow = gvStage.GetSelectedRows()[0]; StageModel model = (StageModel)StageBO.Instance.FindByPK(id); frmAddEditStageHyp frm = new frmAddEditStageHyp(cGlobalVariables.Edit); frm.stageModel = model; if (frm.ShowDialog() == DialogResult.OK) { LoadStage(); LoadMachine(); gvStage.FocusedRowHandle = prevRow; } }
private void Awake() { if (flagEditor != null) { flagEditor.OnDeleteClicked += flagEditorOnDeleteClicked; flagEditor.OnWidthDownClicked += flagEditorOnWidthDownClicked; flagEditor.OnWidthUpClicked += flagEditorOnWidthUpClicked; } if (stageFloor != null) { stageFloor.OnFloorClicked += onFloorClicked; } if (timelinePanel != null) { timelinePanel.OnBackClicked += onBackClicked; timelinePanel.OnForwardClicked += onForwardClicked; } if (topPanelController != null) { topPanelController.OnLoadClicked += onLoadStageClicked; topPanelController.OnSaveClicked += onSaveStageClicked; topPanelController.OnResetClicked += onResetStageClicked; topPanelController.OnClearClicked += onClearStageClicked; topPanelController.OnSnapToGridToggleClicked += onSnapToGridClicked; topPanelController.OnDefaultWidthDownClicked += onDefaultWidthDownClicked; topPanelController.OnDefaultWidthUpClicked += onDefaultWidthUpClicked; } StageModel stageModel = SaveManager.Instance.LoadStage(SaveManager.Instance.CurrentOpenedStageId); if (stageModel == null) { stageModel = SaveManager.Instance.LoadDefaultStage(); } onLoadStageClicked(stageModel); }
/// <summary> /// Supprime un participant au stage /// </summary> public static void SupprimerParticipant(ClubModel club, StageModel s, MembreModel m) { if (m != null) { List <PaiementModel> paiements = PaiementService.PaiementMembre(club, m); foreach (PaiementModel p in paiements) // On parcours la liste des paiements en attente du membre { if (p.Nature is StageModel) // On regarde si il a postuler pour le stage si c'est le cas on valide le paiement { StageModel stage = p.Nature as StageModel; if (stage.Id == s.Id) { PaiementService.SupprimerPaiement(club, p); s.Participants.Remove(m); ModifierStage(club, s); break; } } } } }
private static void Traverse(StageModel stage, IDictionary <string, StageModel> acc) { if (stage.Transitions.Count == 0) { if (!acc.ContainsKey(stage.Key)) { acc.Add(stage.Key, stage); } return; } foreach (var child in stage.Transitions.Values) { Traverse(child, acc); } if (!acc.ContainsKey(stage.Key)) { acc.Add(stage.Key, stage); } }
public static float getStageProgres(int stage, long score) { StagesList stages = StageService.getStages(); float progresStage = 0; StageModel currectStage = stages.stagesList[stage]; if (stage > 0) { StageModel previousStage = stages.stagesList[stage - 1]; long normalDiff = previousStage.maxScore - currectStage.maxScore; long normalScore = previousStage.maxScore - score; progresStage = 0.2f * normalScore / normalDiff; } else { progresStage = 0.2f * score / currectStage.maxScore; } return(progresStage); }
private LeadModel Update(LeadModel leadModel, bool isLastStage = false) { bool isUpdate = false; Lead lead = leadRepository.SingleOrDefault(x => x.LeadId == leadModel.LeadId && x.RecordDeleted == false); StageModel stage = stageBusiness.GetIntialStage((int)lead.CompanyId); if (stage.DefaultRatingId == null) { lead.RatingId = leadModel.RatingId; } if (lead != null) { if (leadModel.StageId != null && leadModel.StageId > 0) { lead.StageId = leadModel.StageId; isUpdate = true; } if (leadModel.RatingId != null && leadModel.RatingId > 0) { lead.RatingId = leadModel.RatingId; isUpdate = true; } if (isUpdate) { lead.IsClosedWin = leadModel.IsClosedWin; lead.ModifiedBy = leadModel.ModifiedBy; AddLeadToDateAudit(lead, isLastStage); lead.ModifiedBy = leadModel.ModifiedBy; lead.ModifiedDate = DateTime.UtcNow; leadRepository.Update(lead); } } leadModel = new LeadModel(); AutoMapper.Mapper.Map(lead, leadModel); leadModel.Rating.Icons = (leadModel.RatingId == null) ? CommonFunctions.GetRatingImage("", leadModel.Stage.IsLastStage == null ? false : (bool)leadModel.Stage.IsLastStage, leadModel.IsClosedWin == null ? false : (bool)leadModel.IsClosedWin) : CommonFunctions.GetRatingImage(leadModel.Rating.Icons, leadModel.Stage.IsLastStage == null ? false : (bool)leadModel.Stage.IsLastStage, leadModel.IsClosedWin == null ? false : (bool)leadModel.IsClosedWin); return(leadModel); }
public PathOption(int order, Guid tripId, DateTime?startTime, DateTime?endTime, string estimatedTotalCost, int totalWalkingDistance, int initialWalkingDistance, IEnumerable <Stage> stages, IEnumerable <string> fareMessages, string jsonSerializedObject) { this.Order = order; this.IsUber = false; this.EstimatedTotalCost = estimatedTotalCost; this.TripId = tripId; if (startTime.HasValue) { this.StartTime = startTime.Value.ToLocalTime(); } if (endTime.HasValue) { this.EndTime = endTime.Value.ToLocalTime(); } this.TotalWalkingDistance = totalWalkingDistance; this.InitialWalkingDistance = initialWalkingDistance; this.Stages = stages.ToList(); this.StageDisplays.Add(StageModel.Waiting((int)maxDisplayWidth)); this.JsonSerializedObject = jsonSerializedObject; this.RouteStops.AddRange(this.Stages.Where(x => x.Mode.ApplicationTransportMode != ApplicationTransportMode.Pedestrian).SelectMany(x => x.StagePoints)); UpdateStagesIncludeWaiting(); this.FareMessages = fareMessages; if (this.Stages.Count() == 1 && this.Stages.First().Mode.ApplicationTransportMode == Enums.ApplicationTransportMode.Pedestrian) { isWalkingOnly = true; } SetLetter(order); string startTimeDisplay = this.Stages.First().StartTime.ToString("HH:mm"); string endTimeDisplay = (this.Stages.Any(x => x.Mode.ApplicationTransportMode != ApplicationTransportMode.Pedestrian)) ? this.Stages.Where(x => x.Mode.ApplicationTransportMode != ApplicationTransportMode.Pedestrian).Last().EndTime.ToString("HH:mm") : this.Stages.Last().EndTime.ToString("HH:mm"); this.TimeDisplay = string.Format(AppResources.TripSelectionTimeDisplay, startTimeDisplay, endTimeDisplay); }
public StageModel GetNextStage(ChapterModel chapter, StageModel stage) { if (chapter.Stages.Contains(stage.Id)) { int stageIndex = 0; for (int i = 0; i < chapter.Stages.Length; i++) { stageIndex++; if (stage.Id == chapter.Stages[i]) { break; } } if (stageIndex < chapter.Stages.Length) { int nextStageId = chapter.Stages[stageIndex]; return(StageListData[nextStageId].Stage); } } return(null); }
public void LoadStageWithId(int stageId) { float bezierCurveFactor = 3.5f; if (stageModel != null) { bezierCurveFactor = stageModel.BezierCurveFactor; } StageModel newStageModel = SaveManager.Instance.LoadStage(stageId); if (newStageModel != null) { stageModel = newStageModel; } else { stageModel = new StageModel(); } stageModel.BezierCurveFactor = bezierCurveFactor; stageModel.RefreshPointsRightAndLeft(); RefreshGeometry(); }
public void loadStage() { stages = StageService.getStages(); currentStage = stages.stagesList[0]; }
/// <summary> /// Retourne true si le membre participe au stage /// </summary> public static bool ParticipeAuStage(MembreModel m, StageModel s) { return(s.Participants.Contains(m)); }
public void SetUp(int chapter_id, StageModel model) { chapter_id_ = chapter_id; model_ = model; text_.text = model_.Name; }
public void UpdateStageDisplay(DateTime scaledStartTime, bool isScaledStartTime, double maxDurationInMinutes, DateTime end) { if (DateTime.Now > this.Stages.Last().EndTime) { StageDisplays.Clear(); StageDisplays.Add(StageModel.Waiting((int)maxDisplayWidth)); return; } StageDisplays.Clear(); double scale = maxDisplayWidth / maxDurationInMinutes; double runningTime = 0; if (isScaledStartTime) { scale = (maxDisplayWidth - 60) / maxDurationInMinutes; StageDisplays.Add(StageModel.Waiting(60, Visibility.Visible)); } if (this.Stages.First().StartTime < DateTime.Now) { runningTime = (DateTime.Now - this.Stages.First().StartTime).TotalMinutes; } //TODO test with walking! Stage previousStage = null; // Start by adding a stage for time between now and the first stage. if (this.Stages.First().StartTime > scaledStartTime) { double scaledDurationInMinutes = scale * ((this.Stages.First().StartTime - scaledStartTime).TotalMinutes); StageDisplays.Add(StageModel.Waiting((int)(scaledDurationInMinutes))); } // Add the stages as stage models. foreach (Stage stage in Stages) { double scaledDurationInMinutes = 1.0; if (previousStage != null && stage.StartTime > previousStage.EndTime) { if (runningTime < (stage.StartTime - previousStage.EndTime).TotalMinutes) { scaledDurationInMinutes = scale * ((stage.StartTime - previousStage.EndTime).TotalMinutes - runningTime); StageDisplays.Add(StageModel.Waiting((int)(scaledDurationInMinutes))); runningTime = 0; } else { runningTime -= (stage.StartTime - previousStage.EndTime).TotalMinutes; } } previousStage = stage; if (runningTime < stage.Duration) { scaledDurationInMinutes = scale * (stage.Duration - runningTime); StageDisplays.Add(new StageModel(stage.Colour, (int)(scaledDurationInMinutes))); runningTime = 0; } else { runningTime -= stage.Duration; } } // End by adding a stage for time between the end of this path option and the end time of the longest path option. if (this.Stages.Last().EndTime < end) { if (runningTime < (end - this.Stages.Last().EndTime).TotalMinutes) { double scaledDurationInMinutes = scale * ((end - this.Stages.Last().EndTime).TotalMinutes - runningTime); StageDisplays.Add(StageModel.Waiting((int)(scaledDurationInMinutes))); runningTime = 0; } else { runningTime -= (end - this.Stages.Last().EndTime).TotalMinutes; } } // Finally add the extra space to fill the bar within the tile if the trip is short. if (StageDisplays.Sum(x => x.Width) < maxDisplayWidth) { StageDisplays.Add(StageModel.Waiting((int)maxDisplayWidth - StageDisplays.Sum(x => x.Width))); } }
public void OnSceneWasLoaded(object[] arguments) { //Debug.LogFormat("VisualNovelScene OnSceneWasLoaded arguments[0]:{0}", arguments[0]); stage_model_ = arguments[0] as StageModel; }
public static void SetStageModel(StageModel stage_model) { stage_model_ = stage_model; }
public void Initialize(int stageId) { model = GameModel.Instance.Model.GetStageModel(stageId); }