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; }
public int GetScentByOdorAt(Odor odor, Point position) { if (!IsInBounds(position)) { return(0); } OdorScent scent = GetScentByOdor(odor, position); return(scent == null ? 0 : scent.Strength); }
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); } }
/// <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); } }
/// <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); } } }
public OdorScent(Odor odor, int strength) { Odor = odor; Strength = strength; }
public SmellSensor(Odor odorToSmell, int minimumStrength) { m_OdorToSmell = odorToSmell; m_MinStrength = minimumStrength; }
public AIScent(Odor odor, int strength) { this.Odor = odor; this.Strength = strength; }
public SmellSensor(Odor odorToSmell) { m_OdorToSmell = odorToSmell; }
public OdorScent(Odor odor, int strength, Point position) { this.Odor = odor; this.Strength = Math.Min(MAX_STRENGTH, strength); this.Position = position; }
public SmellSensor(Odor odorToSmell) { m_OdorToSmell = odorToSmell; m_List = new List <Percept>(9); }