public Game() { Status = statusType.PLAY; Points = 0; SumOfDices = 0; PlayerID = 0; }
private void SetLabelStatus(statusType st) { if (this.InvokeRequired) { SetLabelStatusDlgt InvokeEnableControl = new SetLabelStatusDlgt(SetLabelStatus); this.Invoke(InvokeEnableControl, new object[] { st }); } else { switch (st) { case statusType.START: tbx_status.Text = ""; tbx_status.BackColor = Color.LightGray; //CleanIVCurves(); break; case statusType.PASS: tbx_status.Text = "OK"; tbx_status.BackColor = Color.LightGreen; break; case statusType.FAIL: tbx_status.Text = "NG"; tbx_status.BackColor = Color.Red; break; default: break; } } }
private void paintBackgroundColor(statusType st) { if (this.InvokeRequired) { paintBackgroundColorDlgt InvokepaintBackgroundColor = new paintBackgroundColorDlgt(paintBackgroundColor); this.Invoke(InvokepaintBackgroundColor, new object[] { st }); } else { switch (st) { case statusType.START: this.BackColor = Color.White; break; case statusType.FAIL: this.BackColor = Color.Red; break; case statusType.PASS: this.BackColor = Color.LightGreen; break; default: break; } this.Refresh(); } }
// REFACTOR_TODO: Either do a switch or use status to index into sprite array Sprite GetStatusImage(statusType status) { switch (status) { default: return(null); } }
StatusAffectData GetAttackingStatusEffect(statusType statusType) { switch (statusType) { default: return(null); } }
StatusAffectData GetPostMoveStatusEffect(statusType statusType) { switch (statusType) { default: return(null); } }
/// <summary> /// EXTENSION METHOD TO RETURN A MORE FRIENDLY TEXT FROM THE VEHICLE STATUS /// </summary> /// <param name="e"></param> /// <returns></returns> public static string EnumText(this statusType e) { switch (e) { case statusType.NeedService: return("Needs Service"); } return(e.ToString()); }
public IEnumerator ChangeDeltStatus(bool isPlayer, statusType status) { string statusKey = status.ToString(); AnimatorWrapper animator = isPlayer ? PlayerStatusAnimator : OpponentStatusAnimator; yield return(animator.TriggerAndWait(statusKey)); SoundEffectManager.Inst.PlaySoundImmediate(statusKey); //REFACTOR_TODO: Have animation use callback to SetDeltStatusSprite }
// status表示.種類で色を変更. private void viewStatus(string text, statusType type) { statusLabel.ForeColor = (type == statusType.status) ? Color.Lime : (type == statusType.progress) ? Color.DodgerBlue : (type == statusType.warning) ? Color.Red : Color.White; statusLabel.Text = text; statusLabel.Update(); }
// ゲームスタート時のカウントダウン処理 void countDown() { startCount--; countDownText.text = startCount.ToString(); // Debug.Log ("COUNTDOWN:" + startCount.ToString ()); if (startCount == 0) { status = statusType.PLAYING_GAME; countDownText.text = ""; } }
public bool HasStatus(statusType type) { foreach (var s in statuses) { if (s.Type == type) { return(true); } } return(false); }
public void StatusChange(bool isPlayer, statusType status) { AddToBattleQueue(enumerator: Animator.ChangeDeltStatus(isPlayer, status)); if (isPlayer) { State.PlayerState.DeltInBattle.curStatus = status; } else { State.OpponentState.DeltInBattle.curStatus = status; } }
public void InsertProducer_Or_ProducerHasNoRegistrationNumber_ValidationSucceeds(string prn, statusType status) { var producer = new producerType() { registrationNo = prn, status = status }; var result = Rule().Evaluate(producer); Assert.True(result.IsValid); }
public void UpdateDeltStatus(bool isPlayer, statusType status) { Sprite statusImage = GetStatusImage(status); DeltInfoUI deltInfo = isPlayer ? PlayerDeltInfo : OpponentDeltInfo; deltInfo.Status.sprite = statusImage; // REFACTOR_TODO: Remove this PlayerBattleState player = isPlayer ? State.PlayerState : State.OpponentState; player.DeltInBattle.statusImage = statusImage; }
public RuleResult Evaluate(ChargeBand producerChargeBand, statusType producerStatus = statusType.A) { var producer = new producerType() { status = producerStatus }; var scheme = new schemeType() { complianceYear = "2016" }; return(producerChargeBandChange.Evaluate(scheme, producer, A.Dummy <Guid>())); }
private static void setStatus(statusType status, string inStatus) { if (!ShowProgress) { if (progressDialog != null) { progressDialog.dispose(); progressDialog = null; } return; } invoker.InvokeOnMainThread(delegate { if (progressDialog == null) { progressDialog = new ProgressDialog("Downloading", delegate { progressDialog.setMessage("Canceling..."); StopDownloading(); }); } if (status == Downloader.statusType.Completed) { // successful completion // tell the user all set progressDialog.dispose(); progressDialog = null; UIAlertView alert = new UIAlertView("Success", "Finished update.", null, "OK"); alert.Show(); } else if (status == statusType.Update) { // no errors - normal status update //this was s progressDialog.setMessage(Path.GetFileNameWithoutExtension(inStatus)); } else { progressDialog.dispose(); progressDialog = null; // some error occurred // tell the user about it UIAlertView alert = new UIAlertView("Error", inStatus, null, "OK"); alert.Show(); } }); }
private void paintBackgroundColor(statusType st) { if (this.InvokeRequired) { paintBackgroundColorDlgt InvokepaintBackgroundColor = new paintBackgroundColorDlgt(paintBackgroundColor); this.Invoke(InvokepaintBackgroundColor, new object[] { st }); } else { switch (st) { case statusType.START: this.BackColor = Color.White; //tbx_SerialWrite.Enabled = false; m_sTagUIDstring = ""; m_sSerialNumber = ""; CleanIVCurves(); // add by genhong.hu ON 2018-01-06 ShowModuleInfo(false); // add by genhong.hu ON 2018-01-06 //SetLabelStatus(statusType.START); break; case statusType.FAIL: this.BackColor = Color.Red; tbx_SerialWrite.Enabled = true; SetLabelStatus(statusType.FAIL); timer.Change(5000, System.Threading.Timeout.Infinite); break; case statusType.PASS: this.BackColor = Color.LightGreen; tbx_SerialWrite.Enabled = true; SetLabelStatus(statusType.PASS); timer.Change(5000, System.Threading.Timeout.Infinite); break; default: break; } this.Refresh(); } }
void ApplyStatusCure() { if (Item.cure != statusType.None) { // If Delt is being cured and didn't need it if (Recipient.curStatus == Item.cure || (Item.cure == statusType.All && Recipient.curStatus != statusType.None)) { statusType oldStatus = Recipient.curStatus; BattleManager.AddToBattleQueue(enumerator: BattleManager.Inst.Animator.DeltAnimation("Cure", IsPlayer)); BattleManager.Inst.StatusChange(true, statusType.None); QueueBattleText(Recipient.nickname + " is no longer " + oldStatus + "!"); } else if (Recipient.curStatus != statusType.None) { QueueBattleText(Item.itemName + " is not meant to cure " + Recipient.curStatus + " Delts..."); } } }
// Update is called once per frame void Update() { //カウントダウン処理 if (status == statusType.BEFORE_START) { timeElapsed += Time.deltaTime; if (timeElapsed >= 1.0) { countDown(); timeElapsed = 0.0f; } return; } if (status == statusType.GAME_OVER) { return; } if (DownKeyCheck()) { return; } timeElapsed += Time.deltaTime; if (timeElapsed >= timeOut) { GameObject movingBlock = GameObject.Find("MovingBlock"); bool conflictBlock = false; foreach (int blockPos in movingBlocksPos) { //-10すると他のブロックにぶつかる? if (movingBlockPos + blockPos >= 10 && movingBlockPos + blockPos < 200 && !conflictBlock) { conflictBlock = blockExistArray [movingBlockPos + blockPos - 10]; } //最下段に達した? if (movingBlockPos + blockPos < 10) { conflictBlock = true; } } //他のブロックにぶつかる・最下段に達したらストップ if (conflictBlock) { if (movingBlock) { movingBlock.name = "StopBlock"; int count = 0; foreach (Transform child in movingBlock.transform) { //child is your child transform int xCellDis = (int)(System.Math.Round((child.position.x - movingBlock.transform.position.x), 1) / 0.4); int yCellDis = (int)(System.Math.Round((child.position.y - movingBlock.transform.position.y), 1) / 0.4); int cell = movingBlockPos + xCellDis + (yCellDis * width); child.name = "StopBlock" + cell; Debug.Log("Child[" + count + "] X:" + xCellDis + "Y:" + yCellDis); count++; } } Debug.Log("FIX.BLOCKS = " + movingBlocksPos [0] + "/" + movingBlocksPos [1] + "/" + movingBlocksPos [2] + "/" + movingBlocksPos [3]); //限界を超えていたらゲームオーバー if (movingBlockPos > width * height | movingBlockPos + movingBlocksPos [1] > width * height | movingBlockPos + movingBlocksPos [2] > width * height | movingBlockPos + movingBlocksPos [3] > width * height) { status = statusType.GAME_OVER; topButton.gameObject.SetActive(true); Debug.Log("Game Over!"); return; } //ブロックがある箇所のbool値をtrueに blockExistArray [movingBlockPos] = true; blockExistArray [movingBlockPos + movingBlocksPos [1]] = true; blockExistArray [movingBlockPos + movingBlocksPos [2]] = true; blockExistArray [movingBlockPos + movingBlocksPos [3]] = true; BlockGenerator.generateBlock(); //ログ string exitsBlock = ""; for (int i = 0; i < 200; i++) { if (blockExistArray [i]) { exitsBlock = exitsBlock + i.ToString(); exitsBlock = exitsBlock + ","; } } // Debug.Log ("FIX.BLOCKS = "+movingBlocksPos[0]+"/"+movingBlocksPos[1]+"/"+movingBlocksPos[2]+"/"+movingBlocksPos[3]); Debug.Log("FIX.BLOCKS = " + exitsBlock); string compLine = ""; int deleteCount = 0; foreach (int line in getCompLines()) { point++; pointText.text = "Point:" + point.ToString(); downBlocksCount(line - deleteCount); downBlocksObject(line - deleteCount); compLine += line.ToString(); deleteCount++; } Debug.Log("COMPLINE = " + compLine); } else { Vector3 pos = movingBlock.transform.position; pos.y -= 0.4f; movingBlock.transform.position = pos; //ポジションが-10 movingBlockPos -= 10; } timeElapsed = 0.0f; } }
public void initializeDelt(bool setMoves = true) { int levels = 0; byte index = 0; nickname = deltdex.nickname; curStatus = statusType.None; experience = 0; AVs = new byte[6] { 0, 0, 0, 0, 0, 0 }; AVCount = 0; GPA = 0; Truth = 0; Courage = 0; Faith = 0; Power = 0; ChillToPull = 0; moveset.Clear(); // Update XP needed to level up again XPToLevel = (level * 3) + (level * level * 3); // If Delt has 1-2 prev evols, set stats a little lower // Note: Compensates for Delt not evolving from lower stat state(s) int statMod = level; if (deltdex.prevEvol != null) { // 2 previous evols if (deltdex.prevEvol.prevEvol != null) { statMod = (int)(statMod * 0.7f); } // 1 previous evol else { statMod = (int)(statMod * 0.55f); } } if (deltdex.prevEvol != null) { DeltDexClass prevDex; // Add stats for smallest evolution (if exists) if (deltdex.prevEvol.prevEvol != null) { // Get prev prev evolution dex prevDex = deltdex.prevEvol.prevEvol; levels = prevDex.evolveLevel; // Add previous previous evolution stats GPA += (prevDex.BVs [0] * levels * .02f); Truth += (prevDex.BVs [1] * levels * .02f); Courage += (prevDex.BVs [2] * levels * .02f); Faith += (prevDex.BVs [3] * levels * .02f); Power += (prevDex.BVs [4] * levels * .02f); ChillToPull += (prevDex.BVs [5] * levels * .02f); // If moves need to be set programmatically if (setMoves) { foreach (LevelUpMove lum in prevDex.levelUpMoves) { if (lum.level <= level) { if (moveset.Count < 4) { moveset.Add(lum.move); } else { moveset [index] = lum.move; index = (byte)((index++) % 4); } } else { break; } } } } // Get previous evol dex, calculate number of levels where Delt was that evolution prevDex = deltdex.prevEvol; levels = prevDex.evolveLevel - levels; // Add previous evolution stats GPA += (prevDex.BVs [0] * levels * .02f); Truth += (prevDex.BVs [1] * levels * .02f); Courage += (prevDex.BVs [2] * levels * .02f); Faith += (prevDex.BVs [3] * levels * .02f); Power += (prevDex.BVs [4] * levels * .02f); ChillToPull += (prevDex.BVs [5] * levels * .02f); // Set number of levels as current evolution levels = level - prevDex.evolveLevel; // If moves need to be set programmatically if (setMoves) { foreach (LevelUpMove lum in prevDex.levelUpMoves) { if (lum.level <= level) { if (moveset.Count < 4) { moveset.Add(lum.move); } else { moveset [index] = lum.move; index = (byte)((index++) % 4); } } else { break; } } } } // Delt was always this evolution, no previous else { levels = level; } // Add current evolution stats GPA += (deltdex.BVs [0] * levels * .02f) + 10 + level; Truth += (deltdex.BVs [1] * levels * .02f) + 5 + level; Courage += (deltdex.BVs [2] * levels * .02f) + 5 + level; Faith += (deltdex.BVs [3] * levels * .02f) + 5 + level; Power += (deltdex.BVs [4] * levels * .02f) + 5 + level; ChillToPull += (deltdex.BVs [5] * levels * .02f) + 5 + level; health = GPA; // If moves need to be set programmatically if (setMoves) { index = 0; foreach (LevelUpMove lum in deltdex.levelUpMoves) { if (lum.level <= level) { if (moveset.Count < 4) { moveset.Add(lum.move); } else { moveset [index] = lum.move; index = (byte)((index++) % 4); } } else { return; } } } }
// constructor public StatusEffects(float duration, float amount, statusType statusName) { this.Duration = duration; this.Amount = amount; this.Type = statusName; }
private void InstantiateProducerParameters() { TradingName = "Test trading name"; scheme = A.Fake <Scheme>(); MemberUpload = new MemberUpload( A.Dummy <Guid>(), A.Dummy <string>(), A.Dummy <List <MemberUploadError> >(), A.Dummy <decimal>(), A.Dummy <int>(), scheme, A.Dummy <string>(), A.Dummy <string>(), A.Dummy <bool>()); ProducerCharges = new Dictionary <string, ProducerCharge>(); ProducerCharges.Add(TradingName, new ProducerCharge() { ChargeBandAmount = new ChargeBandAmount() }); GeneratedPrns = new Queue <string>(); A.CallTo(() => DataAccess.ComputePrns(A <int> ._)).Returns(GeneratedPrns); BrandNames = Enumerable.Empty <string>().ToArray(); SicCodes = Enumerable.Empty <string>().ToArray(); ProducerBusiness = new producerBusinessType() { correspondentForNotices = new optionalContactDetailsContainerType() { }, Item = new companyType() { registeredOffice = new contactDetailsContainerType() { contactDetails = new contactDetailsType() { address = new addressType() { country = countryType.UKENGLAND } } } } }; AuthorisedRepresentative = null; EEEPlacedOnMarketBandType = eeePlacedOnMarketBandType.Lessthan5TEEEplacedonmarket; SellingTechnique = sellingTechniqueType.Both; ObligationType = obligationTypeType.Both; AnnualTurnoverBandType = annualTurnoverBandType.Greaterthanonemillionpounds; CeaseDate = null; RegistrationNumber = "TestRegistrationNumber"; AnnualTurnover = 10; VatRegistered = false; Status = statusType.I; }
public RuleResult Evaluate(ChargeBand producerChargeBand, statusType producerStatus = statusType.A) { var producer = new producerType() { status = producerStatus }; var scheme = new schemeType() { complianceYear = "2016" }; A.CallTo(() => ProducerChargeBandCalculator.GetProducerChargeBand(A<annualTurnoverBandType>._, A<bool>._, A<eeePlacedOnMarketBandType>._)) .Returns(producerChargeBand); return producerChargeBandChange.Evaluate(scheme, producer, A.Dummy<Guid>()); }
private static void setStatus(statusType status, string inStatus) { if (!ShowProgress) { if (progressDialog != null) { progressDialog.dispose (); progressDialog = null; } return; } invoker.InvokeOnMainThread (delegate { if (progressDialog == null) { progressDialog = new ProgressDialog ("Downloading", delegate { progressDialog.setMessage ("Canceling..."); StopDownloading (); }); } if (status == Downloader.statusType.Completed) { // successful completion // tell the user all set progressDialog.dispose (); progressDialog = null; UIAlertView alert = new UIAlertView ("Success", "Finished update.", null, "OK"); alert.Show (); } else if (status == statusType.Update) { // no errors - normal status update //this was s progressDialog.setMessage (Path.GetFileNameWithoutExtension (inStatus)); } else { progressDialog.dispose (); progressDialog = null; // some error occurred // tell the user about it UIAlertView alert = new UIAlertView ("Error", inStatus, null, "OK"); alert.Show (); } }); }
public void InsertProducer_Or_ProducerHasNoRegistrationNumber_ValidationSucceeds(string prn, statusType status) { var producer = new producerType() { registrationNo = prn, status = status }; var result = Rule().Evaluate(producer); Assert.True(result.IsValid); }
private void InstantiateProducerParameters() { TradingName = "Test trading name"; scheme = A.Fake<Scheme>(); MemberUpload = new MemberUpload( A.Dummy<Guid>(), A.Dummy<string>(), A.Dummy<List<MemberUploadError>>(), A.Dummy<decimal>(), A.Dummy<int>(), scheme, A.Dummy<string>(), A.Dummy<string>()); ProducerCharges = new Dictionary<string, ProducerCharge>(); ProducerCharges.Add(TradingName, new ProducerCharge() { ChargeBandAmount = new ChargeBandAmount() }); GeneratedPrns = new Queue<string>(); A.CallTo(() => DataAccess.ComputePrns(A<int>._)).Returns(GeneratedPrns); BrandNames = Enumerable.Empty<string>().ToArray(); SicCodes = Enumerable.Empty<string>().ToArray(); ProducerBusiness = new producerBusinessType() { correspondentForNotices = new optionalContactDetailsContainerType() { }, Item = new companyType() { registeredOffice = new contactDetailsContainerType() { contactDetails = new contactDetailsType() { address = new addressType() { country = countryType.UKENGLAND } } } } }; AuthorisedRepresentative = null; EEEPlacedOnMarketBandType = eeePlacedOnMarketBandType.Lessthan5TEEEplacedonmarket; SellingTechnique = sellingTechniqueType.Both; ObligationType = obligationTypeType.Both; AnnualTurnoverBandType = annualTurnoverBandType.Greaterthanonemillionpounds; CeaseDate = null; RegistrationNumber = "TestRegistrationNumber"; AnnualTurnover = 10; VatRegistered = false; Status = statusType.I; }
public void UpdateProducerSubmissionAmount(Guid memberUploadId, string name, ProducerCharge producerCharge, statusType status, producerType producerType) { var producersMember = context.ProducerSubmissions .Where(p => p.MemberUploadId == memberUploadId).ToList(); var producer = producersMember.Where(p => p.ProducerBusiness.CompanyDetails != null && p.ProducerBusiness.CompanyDetails.Name.Trim().Equals(name.Trim()) || (p.ProducerBusiness.Partnership != null && p.ProducerBusiness.Partnership.Name.Trim().Equals(name.Trim()))).ToList(); Log.Information("number found {0}", producer.Count); if (producer.Count() == 1) { //throw new ApplicationException(string.Format("Producer with name {0} in upload {1} could not be updated", name, memberUploadId)); Log.Information(string.Format("Producer charge for {0} updated from {1} to {2} and from band {3} to {4}", name, producer.First().ChargeThisUpdate, producerCharge.Amount, producer.First().ChargeBandAmount.ChargeBand, producerCharge.ChargeBandAmount.ChargeBand)); producer.First().UpdateCharge(producerCharge.Amount, producerCharge.ChargeBandAmount, (int)status); context.SaveChanges(); } else { Log.Information(string.Format("last chance to find user {0}", producerType.tradingName)); var company = producerType.producerBusiness.Item; var findProducer = new List <ProducerSubmission>(); if (company.GetType() == typeof(companyType)) { Log.Information(string.Format("1. {0}", ((companyType)company).companyName)); var test = context.ProducerSubmissions .Where(p => p.MemberUploadId == memberUploadId).Where(p => p.ProducerBusiness.CompanyDetails != null); foreach (var producerSubmission in test) { Log.Information(string.Format("{0}", producerSubmission.ProducerBusiness.CompanyDetails.Name)); } findProducer = context.ProducerSubmissions .Where(p => p.MemberUploadId == memberUploadId && p.ProducerBusiness.CompanyDetails != null && p.ProducerBusiness.CompanyDetails.Name.Trim().Equals(((companyType)company).companyName.Trim())).ToList(); } else if (company.GetType() == typeof(partnershipType)) { Log.Information(string.Format("2. {0}", ((partnershipType)company).partnershipName)); findProducer = context.ProducerSubmissions .Where(p => p.MemberUploadId == memberUploadId && p.ProducerBusiness.Partnership != null && p.ProducerBusiness.Partnership.Name.Trim().Equals(((partnershipType)company).partnershipName.Trim())).ToList(); } if (producer.Count() == 1) { Log.Information(string.Format("Producer charge for {0} updated from {1} to {2} and from band {3} to {4}", name, producer.First().ChargeThisUpdate, producerCharge.Amount, producer.First().ChargeBandAmount.ChargeBand, producerCharge.ChargeBandAmount.ChargeBand)); findProducer.First().UpdateCharge(producerCharge.Amount, producerCharge.ChargeBandAmount, (int)status); context.SaveChanges(); } else { Log.Information(string.Format("Could not find {0}", name)); } } }