public PropertyIntChange(BaseObject ob, PropertyID propertyID, int value) : base(ob, propertyID) { this.Value = value; }
public ObjectDestructedChange(BaseObject ob) : base(ob) { }
protected PropertyChange(BaseObject ob, PropertyID propertyID) : base(ob) { this.PropertyID = propertyID; }
protected ObjectChange(BaseObject ob) { this.Object = ob; }
public ObjectCreatedChange(BaseObject ob) : base(ob) { }
/// <summary> /// Does the player see location p in object ob /// </summary> public bool Sees(BaseObject ob, IntPoint3 p) { if (m_seeAll) return true; var env = ob as EnvironmentObject; if (env != null) { IVisionTracker tracker = GetVisionTracker(env); return tracker.Sees(p); } /* is it inside one of the controllables? */ var lgo = ob as ConcreteObject; while (lgo != null) { if (m_controllables.Contains(lgo)) return true; lgo = lgo.Parent as ConcreteObject; } return false; }
public bool IsController(BaseObject living) { return(m_controllables.Contains(living)); }
public ObjectVisibility GetObjectVisibility(BaseObject ob) { if (m_seeAll) return ObjectVisibility.All; switch (ob.ObjectType) { case ObjectType.Item: case ObjectType.Living: { var mo = (MovableObject)ob; for (MovableObject o = mo; o != null; o = o.Parent as MovableObject) { if (this.IsController(o)) { // if this player is the controller of the object or any of the object's parent return ObjectVisibility.All; } } if (Sees(mo.Parent, mo.Location)) return ObjectVisibility.Public | ObjectVisibility.Debug; // XXX debug also else return ObjectVisibility.None; } case ObjectType.Environment: return ObjectVisibility.All; default: throw new Exception(); } }
public PropertyStringChange(BaseObject ob, PropertyID propertyID, string value) : base(ob, propertyID) { this.Value = value; }
public PropertyValueChange(BaseObject ob, PropertyID propertyID, ValueType value) : base(ob, propertyID) { this.Value = value; }
public bool IsController(BaseObject living) { return m_controllables.Contains(living); }