public void Clear(ClearType Type) { ProfilerHelper_.Begin(ProfilerElementType.ClearTime); if ((Type & ClearType.Color) == ClearType.Color) { TaskDispatcher_.PushTask(0 % Context_.CoreNum, new ClearColorTask(Context_, 0, (byte)(Context_.ClearColor.B * 255))); TaskDispatcher_.PushTask(1 % Context_.CoreNum, new ClearColorTask(Context_, 1, (byte)(Context_.ClearColor.G * 255))); TaskDispatcher_.PushTask(2 % Context_.CoreNum, new ClearColorTask(Context_, 2, (byte)(Context_.ClearColor.R * 255))); TaskDispatcher_.PushTask(3 % Context_.CoreNum, new ClearColorTask(Context_, 3, (byte)(Context_.ClearColor.A * 255))); } if ((Type & ClearType.Depth) == ClearType.Depth) { TaskDispatcher_.PushTask(4 % Context_.CoreNum, new ClearDepthTask(Context_)); } /*if ((Type & ClearType.Stencil) == ClearType.Stencil) * { * }*/ TaskDispatcher_.Wait(); Context_.FrameCount++; ProfilerHelper_.End(ProfilerElementType.ClearTime); }
void FromIntToClearType(int _type) { switch (_type) { case 0: clearType = ClearType.Defalut; break; case 1: clearType = ClearType.Delivery; break; case 2: clearType = ClearType.Level; break; case 3: clearType = ClearType.Rank; break; default: clearType = ClearType.Defalut; break; } }
public int LockMino(out ClearType ct) { int line = 0; if (!field.IsValid(activeMino)) { GameOver(); } field.LockMino(activeMino);//将当前块并入地形 if (field.LinesCanClear(activeMino) > 0) { combo += 1; CheckClearType(); line = field.Clear(activeMino); statLine += line; } else { combo = 0; } isHeld = false; statPiece++; //bool isWallKick = IsWallKick(operation); AfterLock(); ct = clearType; operation = ""; return(line); }
internal static void InternalClearArea(ClearType type, Vector3 position, float radius) { switch (type) { case ClearType.All: Function.Call("CLEAR_AREA", new Parameter[] { position.X, position.Y, position.Z, radius, true }); return; case ClearType.Chars: Function.Call("CLEAR_AREA_OF_CHARS", new Parameter[] { position.X, position.Y, position.Z, radius }); return; case ClearType.Cars: Function.Call("CLEAR_AREA_OF_CARS", new Parameter[] { position.X, position.Y, position.Z, radius }); return; case ClearType.Cops: Function.Call("CLEAR_AREA_OF_COPS", new Parameter[] { position.X, position.Y, position.Z, radius }); return; case ClearType.Objects: Function.Call("CLEAR_AREA_OF_OBJECTS", new Parameter[] { position.X, position.Y, position.Z, radius }); return; } }
public static void ClearSpaceUsage(ClearType type) { var storage = GetStorage(); if (storage == null) { throw new Exception("storage not found"); } var hash = GetUserMd5Hash(SecurityContext.CurrentAccount.ID); switch (type) { case ClearType.All: storage.DeleteDirectory(string.Empty, hash); break; case ClearType.Month: storage.DeleteFiles(string.Empty, hash, DateTime.MinValue, DateTime.Now.AddMonths(-1)); break; case ClearType.Year: storage.DeleteFiles(string.Empty, hash, DateTime.MinValue, DateTime.Now.AddYears(-1)); break; } }
public override bool Update() { if (IsDirty) { int index = 0; string selection = EvaluateChoice(ref index); if (StringUtils.EqualsIgnoreCase(selection, "color")) { ClearOption = ClearType.Color; } else if (StringUtils.EqualsIgnoreCase(selection, "depth")) { ClearOption = ClearType.Depth; } else if (StringUtils.EqualsIgnoreCase(selection, "stencil")) { ClearOption = ClearType.Stencil; } else { Log.Error("SAS: unrecognized clear command"); } IsDirty = false; } return(true); }
} // ICommandHandler.Start // ---------------------------------------------------------------------- private void Clear(ClearType clearType) { switch (clearType) { case ClearType.TimeRange: WorkingTimePeriod = TimePeriodMode.Year; break; case ClearType.Filter: yearFilter.SetSelection(false); yearMonthFilter.SetSelection(false); dayFilter.SetSelection(false); dayOfWeekFilter.SetSelection(false); break; case ClearType.CollectingRange: CollectMonthStart = null; CollectMonthEnd = null; CollectDayStart = null; CollectDayEnd = null; CollectHourStart = null; CollectHourEnd = null; break; } } // Clear
public static void RankingManage(ref ScoreStruct scoreData, int score, ClearType clear) { if (scoreData.scoreRanking == null) { scoreData.scoreRanking = new RankingStruct[1]; scoreData.scoreRanking[0] = new RankingStruct(StaticValue.playerName, score, clear); return; } int rankingCount = scoreData.scoreRanking.Length; if (rankingCount < Constant.rankingLength) { Array.Resize(ref scoreData.scoreRanking, rankingCount + 1); RankingStruct rankingData = new RankingStruct(StaticValue.playerName, score, clear); scoreData.scoreRanking[rankingCount] = rankingData; } else if (scoreData.scoreRanking[rankingCount - 1].score < score) { RankingStruct rankingData = new RankingStruct(StaticValue.playerName, score, clear); scoreData.scoreRanking[rankingCount - 1] = rankingData; } Array.Sort(scoreData.scoreRanking, (x, y) => y.score - x.score); }
public void SetContent(int rank, string name, int score, ClearType clearType, ClearTypeData clearTypeData) { rankText.text = rank.ToString(); nameText.SetText(name); scoreText.text = score.ToString("D7"); clearText.text = clearTypeData.clearTypes[(int)clearType].clearName; clearText.colorGradientPreset = clearTypeData.clearTypes[(int)clearType].colorGradient; }
public QuestData() { id = 0; length = 0; name = null; content = null; openType = OpenType.Defalut; clearType = ClearType.Defalut; }
public static void ClearArea(ClearType type, Vector3 position, float radius) { if (position == null) { throw new ArgumentNullException(nameof(position)); } Functions.InternalClearArea(type, position, radius); }
public void ClearVideos(ClearType type) { for (int i = 0; i < unitList.Count; ++i) { unitList[i].transform.SetParent(helpPanel.transform, true); unitList[i].Clear(type); } unitList.Clear(); }
public static ClearType CheckClearType(Field field, Mino mino, string op, int combo, bool wasB2B) { ClearType clearType; Field fClone = field.Clone(); fClone.LockMino(mino); int minoId = mino.GetIdInt(); int lines = fClone.LinesCanClear(mino); bool tSpin = false; int tSpinType = 0;//0mini 1single 2double 3triple bool spin = IsWallKick(op); bool pc = fClone.IsAllClear(lines); //bool wasB2b; //int combo; if (mino.id == Mino.MinoID.T)//tspin判定 { bool c, f; c = field.HasThreeCorners(mino); f = field.HasTwoFeets(mino); if (lines == 1) { //Debug.Log(cannotGoUp); if (c && f)//t-spin single { tSpin = true; tSpinType = 1; } else if (c && !f && spin)//t-spin mini { tSpin = true; tSpinType = 0; } } else if (lines == 2 && (c || spin))//t-spin double { tSpin = true; tSpinType = 2; } else if (lines == 3) { tSpin = true; tSpinType = 3; } } clearType = new ClearType(minoId, lines, tSpin, tSpinType, pc, combo, wasB2B); return(clearType); }
/// <summary> /// 获取PurgeTool信息 /// </summary> /// <param name="clearType"></param> /// <param name="PageSize"></param> /// <param name="PageIndex"></param> /// <param name="SortField"></param> /// <param name="callback"></param> public void GetPurgeToolByQuery(ClearType clearType, int PageSize, int PageIndex, string SortField, EventHandler <RestClientEventArgs <dynamic> > callback) { PurgeToolQueryFilter query = new PurgeToolQueryFilter() { PageInfo = new QueryFilter.Common.PagingInfo() { PageIndex = PageIndex, PageSize = PageSize, SortBy = SortField }, ClearType = clearType }; restClient.QueryDynamicData(GetPurgeToolByQueryUrl, query, callback); }
void Mode_Changed(object sender, SelectionChangedEventArgs e) { ClearType selected = (ClearType)ClearMode.SelectedIndex; if (_clear.Mode != selected) { Program.Project.Undo.AddAndExecute(new Clear.ModeUndoEntry( _clear, _clear.Mode, selected )); } }
private void CheckClearType() { int minoId = activeMino.GetIdInt(); int lines = field.LinesCanClear(activeMino); bool tSpin = false; bool spin = IsWallKick(operation); int tSpinType = 0;//0mini 1single 2double 3triple bool pc = field.IsAllClear(lines); //bool wasB2b; //int combo; if (activeMino.id == Mino.MinoID.T)//tspin判定 { bool c, f; c = field.HasThreeCorners(activeMino); f = field.HasTwoFeets(activeMino); if (lines == 1) { //Debug.Log(cannotGoUp); if (c && f)//t-spin single { tSpin = true; tSpinType = 1; } else if (c && !f && spin)//t-spin mini { tSpin = true; tSpinType = 0; } } else if (lines == 2 && (c || spin))//t-spin double { tSpin = true; tSpinType = 2; } else if (lines == 3) { tSpin = true; tSpinType = 3; } } clearType = new ClearType(minoId, lines, tSpin, tSpinType, pc, combo, wasB2B); wasB2B = clearType.GetIsB2b(); statAttack += clearType.GetAttack(); }
private IEnumerator ShowResult() { StaticValue.trackCount++; yield return(Find.GetSceneLoadManager().LoadResultScene()); yield return(null); resultController = GameObject.FindWithTag("ResultController").GetComponent <ResultController>(); ResultData resultData = new ResultData(); ClearType clearType = JudgeClearType(); Difficulty selectDif = StaticValue.difficulty; string musicTitle = musicStruct.musicName; int score = uiCountroller.targetScore; int bestScore = ChartUtility.GetBestScore(StaticValue.loadName, selectDif); resultData.musicTitle = musicTitle; resultData.clearType = clearType; resultData.composer = musicStruct.composer; resultData.difficulty = selectDif; resultData.score = uiCountroller.targetScore; resultData.bestScore = bestScore; resultData.judgeCount = uiData.judgeCount; resultData.level = GetPlayingChart().level; resultData.maxCombo = uiData.maxConbo; resultData.fastCount = inputController.fastCount; resultData.lateCount = inputController.lateCount; resultController.SetUIValue(resultData); yield return(new WaitForSeconds(0.5f)); resultController.PlayResultAnim(true); float loadTime = 2.5f; if (!StaticValue.isAuto) { float nowTime = Time.realtimeSinceStartup; yield return(StartCoroutine(ChartUtility.WriteScoreDataFromResult(StaticValue.loadName, score, selectDif, clearType))); loadTime = Mathf.Clamp(loadTime - Time.realtimeSinceStartup - nowTime, 0, 2.5f); } yield return(new WaitForSeconds(loadTime)); isResult = true; }
public override Resources GetById(int id) { string str = string.Format("select * from ClearType where Id=" + id); DataTable dt = helper.GetData(str); if (dt != null && dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; ClearType cleaType = new ClearType(); cleaType.Id = int.Parse(row[0].ToString()); cleaType.Name = row[1].ToString(); return(cleaType); } else { return(null); } }
void Mode_Changed(object sender, SelectionChangedEventArgs e) { ClearType selected = (ClearType)ClearMode.SelectedIndex; if (_clear.Mode != selected) { ClearType u = _clear.Mode; ClearType r = selected; List <int> path = Track.GetPath(_clear); Program.Project.Undo.Add($"Clear Orientation Changed to {((ComboBoxItem)ClearMode.ItemContainerGenerator.ContainerFromIndex((int)r)).Content}", () => { ((Clear)Track.TraversePath(path)).Mode = u; }, () => { ((Clear)Track.TraversePath(path)).Mode = r; }); _clear.Mode = selected; } }
//private List<Render2Texture*> RTTs; //private RenderQueue* m_RenderQueue; public Camera(Vector3 position, Vector3 target, float fov, Vector3 up, float zNear, float zFar, float aspect) { for (int i = 0; i < mPlans.Count; i++) { mPlans[i] = new float[4]; } isPerspective = true; mMatrixProjection = Matrix4x4.CreatePerspective(fov, aspect, zNear, zFar); mMatrixView = Matrix4x4.CreateLookAt(Transform.Position, target, up); Transform.Rotation = Quaternion.Fromat(mMatrixView); Transform.Position = position; mNear = zNear; mFar = zFar; mFov = fov; mMatrixViewInverse = mMatrixView.Inverse(); mMatrixProjectInverse = mMatrixProjection.Inverse(); mType = ObjectType.eT_Camera; mClearType = (ClearType.eCT_Color | ClearType.eCT_Depth | ClearType.eCT_Stencil); mDepth = 0; }
public static void AddClearPoint(ClearType clearType) { List <Mission> currentMissions = userMissions.FindAll(x => !x.enable && !x.clear && x.clearType == (int)clearType); for (var i = 0; i < currentMissions.Count; i++) { //업적 if (currentMissions[i].missionType == 2) { currentMissions[i].point += 1; } //임무 else { if (currentMissions[i].point < currentMissions[i].clearPoint) { currentMissions[i].point += 1; } } } }
/// <summary> /// Removes some subset of the state. /// </summary> /// <param name="type">The type of data to remove.</param> public void Clear(ClearType type) { switch (type) { case ClearType.All: ClearAll(); break; case ClearType.Dialog: ClearDialog(); break; case ClearType.Choices: ClearChoices(); break; default: throw new InvalidOperationException( "Unknown clear type! Please file a bug report." ); } }
public void AfterLock(ClearType ct) { UpdateGoalText(); if (gameMode == 1)//40L { if (game.statLine >= 40) { game.GameClear(); GameClear(gameTime.ToString("0.00"), false); } } else if (gameMode == 4)//cheese 100L { if (cheeseDigged >= cheeseGoal) { game.GameClear(); GameClear("# " + game.statPiece.ToString(), false); } cheeseDigged += game.field.dig; UpdateGoalText(); if (game.combo <= 0) { game.field.RaiseCheeseGarbage(cheeseGoal - cheeseDigged >= cheeseMaxY?cheeseMaxY: cheeseGoal - cheeseDigged); UpdateFieldDisplay(); } else { game.field.RaiseCheeseGarbage(cheeseGoal - cheeseDigged >= cheeseMinY ? cheeseMinY : cheeseGoal - cheeseDigged); UpdateFieldDisplay(); } } aiHintTimer = 0f; IsAIHintUpdated = false; ClearAIHint(); //UpdateAIHint(); }
public override void ClearColor(float r, float g, float b, float a, ClearType clearType) { uint _type = 0; uint _iclearType = (uint)clearType; if ((_iclearType & (uint)ClearType.eCT_Color) != 0) { gl2.ClearColor(r, g, b, a); _type |= gl2.GL_COLOR_BUFFER_BIT; } if ((_iclearType & (uint)ClearType.eCT_Depth) != 0) { gl2.ClearDepth(1); _type |= gl2.GL_DEPTH_BUFFER_BIT; } if ((_iclearType & (uint)ClearType.eCT_Stencil) != 0) { gl2.ClearStencil(0); _type |= gl2.GL_STENCIL_BUFFER_BIT; } gl2.Clear(_type); }
void ClearTerms(ClearType _type, string _terms) { switch (_type) { case ClearType.Defalut: clearTerms = null; break; case ClearType.Delivery: StringSplit(ref clearTerms, _terms); break; case ClearType.Level: openTerms = new int[1]; openTerms[0] = int.Parse(_terms); break; case ClearType.Rank: openTerms = new int[1]; openTerms[0] = int.Parse(_terms); break; } }
protected void Clear(ClearType type) { int start = 0, end = 0; switch (type) { case ClearType.AboveDialog: start = 2; end = Data._generalInfo.dividerLine; break; case ClearType.Dialog: start = Data._generalInfo.dividerLine + 1; end = Console.BufferHeight; break; case ClearType.Both: start = 2; end = Console.BufferHeight; break; } Clear(start, end); }
/// <summary> /// スコアデータを更新する /// </summary> /// <param name="musicName"></param> /// <param name="score"></param> /// <param name="difficulty"></param> /// <param name="clearType"></param> /// <returns></returns> public static IEnumerator WriteScoreDataFromResult(string musicName, int score, Difficulty difficulty, ClearType clearType) { int chartElement = (int)difficulty; ScoreDataStruct scoreData = null; if (Constant.CompareEnv(GameEnvironment.local)) { scoreData = LoadScoreData(musicName); } else if (Constant.CompareEnv(GameEnvironment.webGL)) { bool isFinish = false; NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject>("MusicData"); query.WhereEqualTo("musicName", musicName); query.Limit = 1; query.FindAsync((List <NCMBObject> objList, NCMBException e) => { if (e != null) { isFinish = true; Debug.LogError(e); } else { string scoreJson = Convert.ToString(objList[0]["scoreData"]); scoreData = JsonUtility.FromJson <ScoreDataStruct>(scoreJson); isFinish = true; } }); // 取得が完了するまで待機 while (!isFinish) { yield return(null); } } if (scoreData == null) { yield break; } ScoreStruct scoreStruct = scoreData.scores[chartElement]; if (scoreData == null) { scoreData = new ScoreDataStruct(); } if (scoreStruct.bestScore < score) { scoreData.scores[chartElement].bestScore = score; } if (scoreStruct.clearType < clearType) { scoreData.scores[chartElement].clearType = clearType; } if (clearType > ClearType.Failed) { scoreData.scores[chartElement].clearCount++; } scoreData.scores[chartElement].playCount++; RankingManage(ref scoreData.scores[chartElement], score, clearType); string scoreDataJson = JsonUtility.ToJson(scoreData); if (Constant.CompareEnv(GameEnvironment.local)) { string filePath = Application.streamingAssetsPath + Constant.musicDataDirectory + "/" + musicName; if (!Directory.Exists(filePath)) { yield break; } string dataFilePath = filePath + "/" + musicName + Constant.scoreExtension; File.WriteAllText(dataFilePath, scoreDataJson); } else if (Constant.CompareEnv(GameEnvironment.webGL)) { bool isFinish = false; NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject>("MusicData"); query.WhereEqualTo("musicName", musicName); query.Limit = 1; query.FindAsync((List <NCMBObject> objList, NCMBException e) => { if (e != null) { isFinish = true; Debug.LogError(e); } else { objList[0]["scoreData"] = scoreDataJson; objList[0].SaveAsync((NCMBException exp) => { if (exp != null) { isFinish = true; Debug.LogError(e); } else { isFinish = true; } }); } }); // 取得が完了するまで待機 while (!isFinish) { yield return(null); } SetScoreCacheStruct(musicName, scoreData); } }
public void SetMode(ClearType mode) => ClearMode.SelectedIndex = (int)mode;
public void setColor(ref TextMeshProUGUI text, ClearType clearType) { text.color = clearTypes[(int)clearType].clearColor; text.colorGradientPreset = clearTypes[(int)clearType].colorGradient; }
private static IWebDriver ClickClearContextMenu(this IWebDriver webDriver, int index, ClearType clearType) { var tab = webDriver.FindElements(By.CssSelector(".nof-tab"))[index]; var loc = (ILocatable)tab; var mouse = ((IHasInputDevices)webDriver).Mouse; mouse.ContextClick(loc.Coordinates); webDriver.WaitForAjaxComplete(); tab.FindElements(By.CssSelector("li a"))[(int)clearType].Click(); webDriver.WaitForAjaxComplete(); var firstTabImg = webDriver.FindElements(By.CssSelector(".nof-tab img")).FirstOrDefault(); if (firstTabImg != null) { firstTabImg.Click(); } return webDriver; }
private static void ClickClearContextMenu(this SafeWebDriverWait wait, int index, ClearType clearType) { var tabCount = wait.Driver.FindElements(By.CssSelector(".nof-tab")).Count; var newCount = clearType == ClearType.ClearThis ? tabCount - 1 : clearType == ClearType.ClearOthers ? 1 : 0; var webDriver = wait.Driver; var tab = webDriver.FindElements(By.CssSelector(".nof-tab"))[index]; var loc = (ILocatable) tab; var mouse = ((IHasInputDevices) webDriver).Mouse; mouse.ContextClick(loc.Coordinates); var selector = string.Format(".ui-menu-item:nth-of-type({0}) a", (int)clearType); wait.Until(wd => wd.FindElement(By.CssSelector(selector))); wait.ClickAndWait(selector, wd => wd.FindElements(By.CssSelector(".nof-tab")).Count == newCount); }
private static IWebDriver ClickClearContextMenu(this IWebDriver webDriver, int index, ClearType clearType) { var tab = webDriver.FindElements(By.CssSelector(".nof-tab"))[index]; var loc = (ILocatable)tab; var mouse = ((IHasInputDevices)webDriver).Mouse; mouse.ContextClick(loc.Coordinates); webDriver.WaitForAjaxComplete(); tab.FindElements(By.CssSelector("li a"))[(int)clearType].Click(); webDriver.WaitForAjaxComplete(); var firstTabImg = webDriver.FindElements(By.CssSelector(".nof-tab img")).FirstOrDefault(); if (firstTabImg != null) { firstTabImg.Click(); } return(webDriver); }
// ---------------------------------------------------------------------- private void Clear( ClearType clearType ) { switch ( clearType ) { case ClearType.TimeRange: WorkingTimePeriod = TimePeriodMode.Year; break; case ClearType.Filter: yearFilter.SetSelection( false ); yearMonthFilter.SetSelection( false ); dayFilter.SetSelection( false ); dayOfWeekFilter.SetSelection( false ); break; case ClearType.CollectingRange: CollectMonthStart = null; CollectMonthEnd = null; CollectDayStart = null; CollectDayEnd = null; CollectHourStart = null; CollectHourEnd = null; break; } }