public ItemSprayScentModel(Gameplay.GameItems.IDs _id, string aName, string theNames, string imageID, int sprayQuantity, Odor odor, int strength, string flavor)
     : base(_id, aName, theNames, imageID, flavor, DollPart.LEFT_HAND)
 {
     MaxSprayQuantity = sprayQuantity;
     Odor             = odor;
     Strength         = strength;
 }
 public ItemSprayScentModel(string aName, string theNames, string imageID, int sprayQuantity, Odor odor, int strength)
     : base(aName, theNames, imageID)
 {
     m_MaxSprayQuantity = sprayQuantity;
     m_Odor             = odor;
     m_Strength         = strength;
 }
Beispiel #3
0
        public int GetScentByOdorAt(Odor odor, Point position)
        {
            if (!IsInBounds(position))
            {
                return(0);
            }

            OdorScent scent = GetScentByOdor(odor, position);

            return(scent == null ? 0 : scent.Strength);
        }
Beispiel #4
0
        OdorScent GetScentByOdor(Odor odor, Point p)
        {
            List <OdorScent> scentsThere;

            if (m_aux_ScentsByPosition.TryGetValue(p, out scentsThere))
            {
                foreach (OdorScent scent in scentsThere)
                {
                    if (scent.Odor == odor)
                    {
                        return(scent);
                    }
                }
                return(null);
            }
            else
            {
                return(null);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Adds or merge a scent.
        /// </summary>
        /// <param name="odor"></param>
        /// <param name="strengthChange"></param>
        /// <param name="position"></param>
        public void ModifyScentAt(Odor odor, int strengthChange, Point position)
        {
            if (!IsInBounds(position))
            {
                throw new ArgumentOutOfRangeException("position");
            }

            OdorScent oldScent = GetScentByOdor(odor, position);

            if (oldScent == null)
            {
                // new odor there.
                OdorScent newScent = new OdorScent(odor, strengthChange, position);
                AddNewScent(newScent);
            }
            else
            {
                // existing odor here.
                oldScent.Change(strengthChange);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Sets odor strength to new strength if is it stronger (more "fresh").
        /// </summary>
        /// <param name="odor"></param>
        /// <param name="freshStrength"></param>
        /// <param name="position"></param>
        public void RefreshScentAt(Odor odor, int freshStrength, Point position)
        {
            if (!IsInBounds(position))
            {
                throw new ArgumentOutOfRangeException(String.Format("position; ({0},{1}) map {2} odor {3}", position.X, position.Y, this.m_Name, odor.ToString()));
            }

            OdorScent oldScent = GetScentByOdor(odor, position);

            if (oldScent == null)
            {
                // new odor there.
                OdorScent newScent = new OdorScent(odor, freshStrength, position);
                AddNewScent(newScent);
            }
            else
            {
                // existing odor here.
                if (oldScent.Strength < freshStrength)
                {
                    oldScent.Set(freshStrength);
                }
            }
        }
Beispiel #7
0
 public OdorScent(Odor odor, int strength)
 {
     Odor     = odor;
     Strength = strength;
 }
Beispiel #8
0
 public SmellSensor(Odor odorToSmell, int minimumStrength)
 {
     m_OdorToSmell = odorToSmell;
     m_MinStrength = minimumStrength;
 }
Beispiel #9
0
 public AIScent(Odor odor, int strength)
 {
     this.Odor     = odor;
     this.Strength = strength;
 }
Beispiel #10
0
 public SmellSensor(Odor odorToSmell)
 {
     m_OdorToSmell = odorToSmell;
 }
Beispiel #11
0
 public OdorScent(Odor odor, int strength, Point position)
 {
     this.Odor     = odor;
     this.Strength = Math.Min(MAX_STRENGTH, strength);
     this.Position = position;
 }
Beispiel #12
0
 public SmellSensor(Odor odorToSmell)
 {
     m_OdorToSmell = odorToSmell;
     m_List        = new List <Percept>(9);
 }