private bool AssingStatus() { var arguments = _args.ToList(); if (ArgumentsExist(arguments)) { return(true); } if (arguments.Contains("-v")) { _finderStatus = FinderStatus.NotContaining; RemoveCommand(arguments, "-v"); } if (arguments.Contains("-color")) { _colorStatus = ColorStatus.Colored; RemoveCommand(arguments, "-color"); } if (ArgumentsExist(arguments)) { return(true); } _chain = arguments.FirstOrDefault(); if (arguments.Count > 1) { _path = arguments.LastOrDefault(); } return(false); }
public Command(string[] args) { _args = args; _colorStatus = ColorStatus.NotColored; _finderStatus = FinderStatus.Containing; _chain = String.Empty; _path = String.Empty; }
public ChangeColorStatus(Agent agentPerformingAction, ColorStatus colorStatus) : base(agentPerformingAction) { switch (colorStatus) { case ColorStatus.Aggressive: this.colorStatus = ColorStatus.Aggressive; break; case ColorStatus.Passive: this.colorStatus = ColorStatus.Passive; break; } }
public static ConsoleColor GetColor(ColorStatus colorStatus) { switch (colorStatus) { case ColorStatus.Colored: return(ConsoleColor.Red); case ColorStatus.NotColored: return(Console.ForegroundColor); default: throw new ArgumentOutOfRangeException(nameof(colorStatus), colorStatus, null); } }
public bool ReturnCommands(out FinderStatus finderStatus, out ColorStatus colorStatus, out string chain, out string path) { finderStatus = FinderStatus.Containing; colorStatus = ColorStatus.NotColored; chain = String.Empty; path = String.Empty; if (_args.Length < 1) { return(true); } bool isError = AssingStatus(); finderStatus = _finderStatus; colorStatus = _colorStatus; chain = _chain; path = _path; return(isError); }
void LoadColorPlayerPrefs() { string PlayerPrefString = PlayerPrefs.GetString("Colors", ""); string[] PlayerPrefArray = PlayerPrefString.Split(','); string NewPlayerPrefString = ""; for (int i = 0; i < ColorList.Length; i++) { ColorList[i].Cost = 120 * i; string Availability = "Unavailable"; if (ColorList[i].Name == "Default") { Availability = "Available"; } foreach (string ColorStatus in PlayerPrefArray) { if (ColorStatus.Split('=')[0] == ColorList[i].Name + "-" + ColorList[i].Cost) { if (ColorStatus.Split('=')[1] == "Equipped" || ColorStatus.Split('=')[1] == "Available" || ColorStatus.Split('=')[1] == "Unavailable") { Availability = ColorStatus.Split('=')[1]; } } } ColorList[i].Status = Availability; NewPlayerPrefString += ColorList[i].Name + "=" + Availability + ","; if (Availability == "Equipped") { CurrentColor = ColorList[i]; } } PlayerPrefs.SetString("Colors", NewPlayerPrefString); //print("Load Colors" + ": " + "Current: " + CurrentColor.Name + "\n" + NewPlayerPrefString); }
protected void ChangeColor(ColorStatus colorStatus) { int parentNumChildren = m_parent.transform.childCount; if (parentNumChildren == 0) return; Transform currentChild = null; SpriteRenderer currentRenderer = null; for (int i = 0; i < parentNumChildren; i++) { currentChild = m_parent.transform.GetChild(i); currentRenderer = currentChild.GetComponent<SpriteRenderer>(); if (currentRenderer != null) { if (colorStatus == ColorStatus.NORMAL) currentRenderer.color = BLUE; else currentRenderer.color = RED; } } }
//TODO Construir mecanismo de chamar um delegate method when finish animation public MacromapShip(Vector2 position, ColorStatus colorStatus) { if (colorStatus == ColorStatus.Colored) { mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(3, "gameplay\\macromap\\barco"), new int[] { 0, 1, 2, 1 }, 9, 132, 109, false, false); } else { mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(3, "gameplay\\macromap\\barcobw"), new int[] { 0, 1, 2, 1 }, 9, 132, 109, false, false); } addSprite(mSpriteNormal, sSTATE_NORMAL); //addSprite(mSpriteExploding, sSTATE_EXPLODING); changeToSprite(sSTATE_NORMAL); setCollisionRect(40, 40); setLocation(position); setVisible(true); pos = new Vector2(300, 0); }
void EquipColor(string ButtonCode) { foreach (ColorStatus ColorStatus in ColorList) { if (ColorStatus.Name == ButtonCode.Split('=')[1]) { if (ColorStatus.Status == "Available") { CurrentColor.Status = "Available"; CurrentColor = ColorStatus; ColorStatus.Status = "Equipped"; PlayerPrefs.SetString("CurrentColors", ColorStatus.Name); audioSource.PlayOneShot(SelectionSound); } else if (ColorStatus.Status == "Unavailable" && Hackeronis >= ColorStatus.Cost) { CurrentColor.Status = "Available"; CurrentColor = ColorStatus; ColorStatus.Status = "Equipped"; PlayerPrefs.SetString("CurrentColors", ColorStatus.Name); SpendMoney(ColorStatus.Cost); audioSource.PlayOneShot(BuySound); } else { audioSource.PlayOneShot(FailToBuySound); } SaveColorPlayerPrefs(); DisplayCurrentEquipment(); } } DisplayColorItems(); }