Ejemplo n.º 1
0
        /// <summary>
        ///     Returns true if Order instances are equal
        /// </summary>
        /// <param name="other">Instance of Order to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Order other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Side == other.Side || Side != null && Side.Equals(other.Side)) &&
                   (Sv == other.Sv || Sv != null && Sv.Equals(other.Sv)) &&
                   (Pt == other.Pt || Pt != null && Pt.Equals(other.Pt)) &&
                   (Ot == other.Ot || Ot != null && Ot.Equals(other.Ot)) &&
                   (P == other.P || P != null && P.Equals(other.P)) &&
                   (Sc == other.Sc || Sc != null && Sc.Equals(other.Sc)) &&
                   (Rc == other.Rc || Rc != null && Rc.Equals(other.Rc)) &&
                   (S == other.S || S != null && S.Equals(other.S)) &&
                   (Pd == other.Pd || Pd != null && Pd.Equals(other.Pd)) &&
                   (Rac == other.Rac || Rac != null && Rac.Equals(other.Rac)) &&
                   (Md == other.Md || Md != null && Md.Equals(other.Md)) &&
                   (Sl == other.Sl || Sl != null && Sl.Equals(other.Sl)) &&
                   (Avp == other.Avp || Avp != null && Avp.Equals(other.Avp)) &&
                   (Sm == other.Sm || Sm != null && Sm.Equals(other.Sm)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (Bsp == other.Bsp || Bsp != null && Bsp.Equals(other.Bsp)) &&
                   (Status == other.Status || Status != null && Status.Equals(other.Status)) &&
                   (Sr == other.Sr || Sr != null && Sr.Equals(other.Sr)) &&
                   (Cd == other.Cd || Cd != null && Cd.Equals(other.Cd)));
        }
Ejemplo n.º 2
0
 public void Init(Game game)
 {
     this._game = game;
     base.gameObject.SetActive(true);
     base.gameObject.SetActive(false);
     this._mainMenu.Text = (App.GameType != GameType.Single) ? Sl.GetValue("MAIN MENU") : Sl.GetValue("TO LEVELS");
 }
Ejemplo n.º 3
0
    private void Start()
    {
        Campaign campaign = !this.IsCoop ? App.Campaigns[this.CampaignIndex] : App.CoopCampaigns[this.CampaignIndex];

        this._name.text = Sl.GetValue(campaign.Name);
        Sprite sprite = Resources.Load <Sprite>((!this.IsCoop ? "Campaigns/" : "CoopCampaigns/") + this.CampaignIndex);

        if (sprite != null)
        {
            this._image.sprite = sprite;
        }
        this._locked.SetActive(false);
        if (this.CampaignIndex == -1)
        {
            this._stars.gameObject.SetActive(false);
            this._locked.SetActive(!this.IsCoop ? (PlayerSettings.OpenedCampaign.Value <= 0) : (PlayerSettings.OpenedCoopCampaign.Value <= 0));
            base.IsEnabled = !this._locked.activeSelf;
            if (!base.IsEnabled)
            {
                this._image.color = new Color(0.25f, 0.25f, 0.25f);
            }
            this._unlock.SetActive(false);
        }
        else
        {
            this._stars.gameObject.SetActive(true);
            int num  = campaign.Levels.Count * 3;
            int num2 = 0;
            for (int i = 0; i < campaign.Levels.Count; i++)
            {
                num2 += !this.IsCoop ? PlayerSettings.GetLevelStarsCount(this.CampaignIndex, i) : PlayerSettings.GetCoopLevelStarsCount(this.CampaignIndex, i);
            }
            this._stars.text = num2 + "/" + num;
            this._unlock.SetActive(this.CanBeBought);
            if (this.CanBeBought)
            {
                int num4 = !this.IsCoop ? App.CampaignUnlockCost : App.CoopCampaignUnlockCost;
                this._image.color          = new Color(0.25f, 0.25f, 0.25f);
                this._unlockCoinsText.text = num4.ToString();
                this._stars.gameObject.SetActive(false);
                if (PlayerSettings.Money.Value < num4)
                {
                    Color color = new Color(0.5f, 0.5f, 0.5f);
                    this._unlockCoinsText.color = color;
                    this._unlockCoinsIcon.color = color;
                    base.IsEnabled = false;
                }
            }
            if (!base.IsEnabled)
            {
                if (!this.CanBeBought)
                {
                    this._locked.SetActive(true);
                    this._image.color = new Color(0.25f, 0.25f, 0.25f);
                }
                this._stars.gameObject.SetActive(false);
            }
        }
    }
Ejemplo n.º 4
0
        private bool IsAlowedColumn()
        {
            var Selected     = RelatedGrid.Selected.Cells.All.Select(C => ((UltraGridCell)C).Column.Key.ToString()).Distinct().ToList();
            var AlowedValues = OperationsByCols.Where(Op => Selected.Any(Sl => Sl.Contains(Op.ColName))).ToList();

            if (AlowedValues.Count == Selected.Count())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
    public override void Init()
    {
        for (int i = 0; i < this._levelIcons.Count; i++)
        {
            UnityEngine.Object.Destroy(this._levelIcons[i].gameObject);
        }
        Campaign campaign = App.CoopCampaigns[App.CurrentCampaign];

        this._levelIcons.Clear();
        this._campaignName.text = Sl.GetValue(campaign.Name).ToUpper();
        if (App.CurrentCampaign == -1)
        {
            this._random.SetActive(true);
        }
        else
        {
            this._random.SetActive(false);
            float num2 = (-this._elementSize * this._columns) * 0.5f;
            float num3 = (this._elementSize * this._rows) * 0.5f;
            for (int j = 0; j < this._rows; j++)
            {
                for (int k = 0; k < this._columns; k++)
                {
                    int level = (this._columns * j) + k;
                    if (level > (campaign.Levels.Count - 1))
                    {
                        break;
                    }
                    LevelIcon item = (LevelIcon)UnityEngine.Object.Instantiate(this._levelIconPrefab);
                    item.transform.parent        = base.transform;
                    item.transform.localPosition = new Vector3(num2 + (this._elementSize * (k + 0.5f)), num3 - (this._elementSize * (j + 0.5f)));
                    item.Number = level;
                    item.Stars  = PlayerSettings.GetCoopLevelStars(App.CurrentCampaign, level);
                    if (App.CurrentCampaign < PlayerSettings.OpenedCoopCampaign.Value)
                    {
                        item.IsEnabled = true;
                    }
                    else
                    {
                        item.IsEnabled = level <= PlayerSettings.OpenedCoopLevel.Value;
                    }
                    object[] args = new object[] { "scale", Vector3.zero, "time", 0.5f, "delay", 0.1f + UnityEngine.Random.Range((float)0f, (float)0.15f), "easetype", iTween.EaseType.easeOutElastic };
                    iTween.ScaleFrom(item.gameObject, iTween.Hash(args));
                    this._levelIcons.Add(item);
                }
            }
        }
    }
Ejemplo n.º 6
0
 protected override void OnMouseUp()
 {
     if (base.IsEnabled && base._hold)
     {
         if (this.CanBeBought)
         {
             MessageBox.Show(Sl.GetValue("Unlock Campaign"), string.Format(Sl.GetValue("UnlockDesc"), this._name.text), delegate {
                 if (this.IsCoop)
                 {
                     PlayerSettings.OpenedCoopCampaign.SetAndSave(this.CampaignIndex);
                     PlayerSettings.OpenedCoopLevel.SetAndSave(0);
                     PlayerSettings.Money.SetAndSave(PlayerSettings.Money.Value - App.CoopCampaignUnlockCost);
                 }
                 else
                 {
                     PlayerSettings.OpenedCampaign.SetAndSave(this.CampaignIndex);
                     PlayerSettings.OpenedLevel.SetAndSave(0);
                     PlayerSettings.Money.SetAndSave(PlayerSettings.Money.Value - App.CampaignUnlockCost);
                 }
                 UnityEngine.Object.FindObjectOfType <CoopCampaignMenu>().UpdateCampaigns();
                 UnityEngine.Object.FindObjectOfType <CampaignMenu>().UpdateCampaigns();
             }, null, true, 0.15f, null);
         }
         else
         {
             App.CurrentCampaign = this.CampaignIndex;
             if (this.IsCoop)
             {
                 PlayerSettings.LastCoopCampaign.SetAndSave(this.CampaignIndex);
             }
             else
             {
                 PlayerSettings.LastCampaign.SetAndSave(this.CampaignIndex);
             }
             base.OnMouseUp();
         }
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Side != null)
                {
                    hash = hash * 59 + Side.GetHashCode();
                }

                if (Sv != null)
                {
                    hash = hash * 59 + Sv.GetHashCode();
                }

                if (Pt != null)
                {
                    hash = hash * 59 + Pt.GetHashCode();
                }

                if (Ot != null)
                {
                    hash = hash * 59 + Ot.GetHashCode();
                }

                if (P != null)
                {
                    hash = hash * 59 + P.GetHashCode();
                }

                if (Sc != null)
                {
                    hash = hash * 59 + Sc.GetHashCode();
                }

                if (Rc != null)
                {
                    hash = hash * 59 + Rc.GetHashCode();
                }

                if (S != null)
                {
                    hash = hash * 59 + S.GetHashCode();
                }

                if (Pd != null)
                {
                    hash = hash * 59 + Pd.GetHashCode();
                }

                if (Rac != null)
                {
                    hash = hash * 59 + Rac.GetHashCode();
                }

                if (Md != null)
                {
                    hash = hash * 59 + Md.GetHashCode();
                }

                if (Sl != null)
                {
                    hash = hash * 59 + Sl.GetHashCode();
                }

                if (Avp != null)
                {
                    hash = hash * 59 + Avp.GetHashCode();
                }

                if (Sm != null)
                {
                    hash = hash * 59 + Sm.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (Bsp != null)
                {
                    hash = hash * 59 + Bsp.GetHashCode();
                }

                if (Status != null)
                {
                    hash = hash * 59 + Status.GetHashCode();
                }

                if (Sr != null)
                {
                    hash = hash * 59 + Sr.GetHashCode();
                }

                if (Cd != null)
                {
                    hash = hash * 59 + Cd.GetHashCode();
                }

                return(hash);
            }
        }