Esempio n. 1
0
        /// <summary>
        /// Set Amount of Available Land
        /// </summary>
        /// <param name="NewValue"></param>
        public void Set(double NewValue)
        {
            if ((NewValue < 0) || (NewValue > this.LandArea))
            {
                Summary.WriteMessage(this, "Tried to Set Available Land to Invalid New Amount." + Environment.NewLine
                                     + "New Value must be between 0 and the Land Area.");
            }
            else
            {
                this._AreaAvailable = NewValue;

                if (LandChanged != null)
                {
                    LandChanged.Invoke(this, new EventArgs());
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Add Available Land
        /// </summary>
        /// <param name="AddAmount"></param>
        public void Add(double AddAmount)
        {
            if (this._AreaAvailable + AddAmount > this.LandArea)
            {
                string message = "Tried to add more available land to " + this.Name + " than exists." + Environment.NewLine
                                 + "Current Amount: " + this._AreaAvailable + Environment.NewLine
                                 + "Tried to Remove: " + AddAmount;
                Summary.WriteWarning(this, message);
                this._AreaAvailable = this.LandArea;
            }
            else
            {
                this._AreaAvailable = this._AreaAvailable + AddAmount;
            }

            if (LandChanged != null)
            {
                LandChanged.Invoke(this, new EventArgs());
            }
        }