public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Value")] ScoreValue scoreValue) { if (id != scoreValue.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(scoreValue); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ScoreValueExists(scoreValue.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(scoreValue)); }
public void SaveScore(string name) { if (File.Exists(filePath)) { string scoreInfo = File.ReadAllText(filePath); string[] scoreVals = scoreInfo.Split('\n'); foreach (string scoreVal in scoreVals) { if (scoreVal != string.Empty) { ScoreValue val = JsonUtility.FromJson <ScoreValue>(scoreVal); scores.Add(val); } } } ScoreValue newScore = new ScoreValue(); newScore.scoreValue = score; if (name != string.Empty) { newScore.name = name; } scores.Add(newScore); sortScoreDescendingOrder sorter = new sortScoreDescendingOrder(); scores.Sort(sorter); string temp = ""; foreach (ScoreValue scoreVal in scores) { temp += JsonUtility.ToJson(scoreVal) + "\n"; } File.WriteAllText(filePath, temp); }
public void Initialize() { ScoreValue = GameValues.FloatingCoinScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildFloatingCoinSprite(parent.Position); CollisionRectangle = sprite.SpriteDestinationRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), parent.Position, false); }
internal SportsMatchResult(string halfScore, string finalScore) { string[] halfResult = halfScore.Split(':'); string[] finalResult = finalScore.Split(':'); HalfScore = new ScoreValue(int.Parse(halfResult[0]), int.Parse(halfResult[1])); FinalScore = new ScoreValue(int.Parse(finalResult[0]), int.Parse(finalResult[1])); }
private void UpdateCall(ScoreValue value) { if (OnUpdateScore != null) { OnUpdateScore(value); } }
public bool Equals(DestinyRecordCompletionBlock input) { if (input == null) { return(false); } return (( PartialCompletionObjectiveCountThreshold == input.PartialCompletionObjectiveCountThreshold || (PartialCompletionObjectiveCountThreshold.Equals(input.PartialCompletionObjectiveCountThreshold)) ) && ( ScoreValue == input.ScoreValue || (ScoreValue.Equals(input.ScoreValue)) ) && ( ShouldFireToast == input.ShouldFireToast || (ShouldFireToast != null && ShouldFireToast.Equals(input.ShouldFireToast)) ) && ( ToastStyle == input.ToastStyle || (ToastStyle != null && ToastStyle.Equals(input.ToastStyle)) )); }
public FlippedKoopaShell(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.KoopaShellScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildEnemyFlippedKoopaShellSprite(position); CollisionRectangle = sprite.SpriteDestinationRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, true); }
public override Int32 GetHashCode() { return(GameID.GetHashCode() ^ DataID.GetHashCode() ^ SaveTime.GetHashCode() ^ DataName.GetHashCode() ^ ScoreValue.GetHashCode()); }
public void Initialize() { ScoreValue = GameValues.RotatingCoinScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildRotatingCoinSprite(parent.Position); CollisionRectangle = sprite.SpriteDestinationRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), parent.Position, false); stoppingPosition = parent.Position.Y - GameValues.BlockRotatingCoinStoppingYPosition; }
public ComingOutOfShellKoopa(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.ComingOutOfShellKoopaScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildEnemyComingOutOfShellKoopaSprite(position); CollisionRectangle = sprite.SpriteDestinationRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, false); }
public void Initialize() { ScoreValue = GameValues.StarScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildStarSprite(parent.Position); CollisionRectangle = sprite.SpriteDestinationRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), parent.Position, false); stoppingPosition = parent.Position.Y - CollisionRectangle.Height; }
public DeadGoomba(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.GoombaScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildEnemyDeadGoombaSprite(position); CollisionRectangle = GameValues.EmptyCollisionRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, false); }
public bool TryGetScore(string uid, out ScoreValue value) { value = null; if (_scoreData.TryGetScore(uid, out value)) { return(true); } return(false); }
public BowserDead(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.BowserScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildBowserDeadSprite(position); CollisionRectangle = sprite.SpriteDestinationRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, true); timeout = GameValues.EnemyDeadEnemyTimeout; }
public CrawfisDead(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.CrawfisScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildCrawfisDeadSprite(position); CollisionRectangle = GameValues.EmptyCollisionRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, true); timeout = GameValues.EnemyDeadEnemyTimeout; }
public void Initialize() { ScoreValue = GameValues.PowerUpScoreValue; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), parent.Position, false); mushroomSprite = AnimatedSpriteFactory.Instance.BuildMushroomSprite(parent.Position); fireFlowerSprite = AnimatedSpriteFactory.Instance.BuildFireFlowerSprite(parent.Position); stoppingPosition = parent.Position.Y - mushroomSprite.Texture.Height; CollisionRectangle = mushroomSprite.SpriteDestinationRectangle; }
public FlippedGoomba(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.GoombaScoreValue; HUD.Instance.ScoreHUDCounter += ScoreValue; sprite = AnimatedSpriteFactory.Instance.BuildEnemyFlippedGoombaSprite(position); CollisionRectangle = sprite.SpriteDestinationRectangle; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, true); }
public HidingInsideShellKoopa(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.KoopaShellScoreValue; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, false); Velocity = Vector2.Zero; sprite = AnimatedSpriteFactory.Instance.BuildEnemyHidingInsideShellKoopaSprite(position); CollisionRectangle = sprite.SpriteDestinationRectangle; }
public RightWalkingKoopa(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.KoopaScoreValue; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, false); Velocity = GameValues.RightWalkingKoopaInitialVelocity; sprite = AnimatedSpriteFactory.Instance.BuildEnemyRightWalkingKoopaSprite(new Vector2(position.X, position.Y)); CollisionRectangle = sprite.SpriteDestinationRectangle; }
public BowserLeft(Vector2 position, Enemy parent) { this.parent = parent; ScoreValue = GameValues.BowserScoreValue; ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, false); Velocity = GameValues.BowserInitialVelocity; sprite = AnimatedSpriteFactory.Instance.BuildBowserLeftWalkingClosedSprite(new Vector2(position.X, position.Y)); CollisionRectangle = sprite.SpriteDestinationRectangle; }
public override void SceneInitialize() { base.SceneInitialize(); ScoreValue.ObserveEveryValueChanged(score => score.Value).Subscribe(OnValueChangeScore); BestScoreValue.ObserveEveryValueChanged(score => score.Value).Subscribe(OnValueChangeBestScore); InitializePazzle(); }
public void TestImplicitScoreValue() { ScoreValue scoreValue = new ScoreValue(ID.Selector.s, new Objective("scores")); Objective objective = scoreValue; BaseSelector selector = scoreValue; Assert.AreEqual("scores", objective.Name, "Objective wasn't converted correctly"); Assert.AreEqual("@s", selector.GetSelectorString(), "Selector wasn't converted correctly"); }
public GameData(ScoreValue value, TimeSpan limit, string levelMessage, int maxRows, int advanceRows, int speed, int maxSpeed) { scoreValue = value; timeLimit = limit; levelUpMessage = levelMessage; maximumRows = maxRows; rowsToAdvance = advanceRows; startSpeed = speed; maximumSpeed = maxSpeed; }
public void TestScoreValue() { ScoreValue scoreValue = new ScoreValue(ID.Selector.s, new Objective("scores")); Assert.AreEqual("@s", scoreValue.Selector.GetSelectorString(), "Constructor didn't set selector correctly"); Assert.AreEqual("scores", scoreValue.ScoreObject.Name, "Constructor didn't set objective correctly"); Assert.ThrowsException <ArgumentNullException>(() => new ScoreValue(ID.Selector.s, null !), "Objective may not be null"); Assert.ThrowsException <ArgumentNullException>(() => new ScoreValue(null !, new Objective("scores")), "Selector may not be null"); Assert.ThrowsException <ArgumentException>(() => new ScoreValue(ID.Selector.e, new Objective("scores")), "Selector may not select multiple entities"); }
override public String ToString() { if (type.Equals(GUIType.text)) { return(ScoreName.ToString() + ScoreValue.ToString(UtilityClass.ScoreFormat)); } else { return(ScoreName.ToString() + ScoreValue.ToString()); } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.layer == 9) { //Debug.Log(collision.gameObject); ScoreValue value = collision.gameObject.GetComponent <ScoreValue>(); AddScore(value.Value); ScoreMultiplier += value.MultiplierValue; Destroy(collision.gameObject); } }
public async Task <IActionResult> Create([Bind("Id,Name,Value")] ScoreValue scoreValue) { if (ModelState.IsValid) { _context.Add(scoreValue); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(scoreValue)); }
/// <summary> /// スコアを再計算する /// </summary> private void RefreshScore() { int judgeRate = JudgeCount[MusicJudgeKind.PerfectGreat] * 100 + JudgeCount[MusicJudgeKind.FastGreat] * 99 + JudgeCount[MusicJudgeKind.SlowGreat] * 99 + JudgeCount[MusicJudgeKind.FastGood] * 70 + JudgeCount[MusicJudgeKind.SlowGood] * 70; ScoreValue = 10000 * judgeRate / totalNotesCount; scoreText.text = ScoreValue.ToString(); }
public override string ToString() { var sb = new StringBuilder(); sb.Append(RawScore?.Code + " "); var placePart = ScoreValue?.ToString("N1", CultureInfo.CurrentCulture) ?? RawScore?.Place?.ToString("N1", CultureInfo.CurrentCulture); sb.Append(placePart); return(sb.ToString().Trim()); }
private ScoreValue GetScoreValueByScoreValueType(string scoreValueType) { ScoreValue score = scoreComponent.Score.ScoreValues.FirstOrDefault(a => a.ScoreValueType == scoreValueType && a.Score.Active == true); if (score == null) { score = new ScoreValue() { ScoreValueId = Guid.Empty, value = 0, ScoreValueType = scoreValueType }; scoreComponent.Score.ScoreValues.Add(score); } return(score); }
public static IList<PatientProfileMatch> CreateList(PatientProfile self, IList<PatientProfile> profileList, ScoreValue score) { IList<PatientProfileMatch> matchList = new List<PatientProfileMatch>(); foreach (PatientProfile profile in profileList) { bool found = false; foreach (PatientProfile existing in self.Patient.Profiles) { if (profile.Equals(existing)) { found = true; break; } } if (found == false) { matchList.Add(new PatientProfileMatch(profile, score)); } } return matchList; }
///<summary>Sets the value of the <c><ScoreValues></c> element.</summary> /// <param name="ScoreValue">A ScoreValue</param> ///<remarks> /// <para>This form of <c>setScoreValues</c> is provided as a convenience method /// that is functionally equivalent to the <c>ScoreValues</c></para> /// <para>Version: 2.6</para> /// <para>Since: 2.6</para> /// </remarks> public void SetScoreValues( ScoreValue ScoreValue ) { RemoveChild( AssessmentDTD.SIF3ASSESSMENTSCORETABLE_SCOREVALUES); AddChild( AssessmentDTD.SIF3ASSESSMENTSCORETABLE_SCOREVALUES, new ScoreValues( ScoreValue ) ); }
public PatientProfileMatch(PatientProfile patientProfile, ScoreValue score) { _patientProfile = patientProfile; _score = score; }