Inheritance: IBaseObject
Example #1
0
 public PropertyIntChange(BaseObject ob, PropertyID propertyID, int value)
     : base(ob, propertyID)
 {
     this.Value = value;
 }
Example #2
0
 public ObjectDestructedChange(BaseObject ob)
     : base(ob)
 {
 }
Example #3
0
 protected PropertyChange(BaseObject ob, PropertyID propertyID)
     : base(ob)
 {
     this.PropertyID = propertyID;
 }
Example #4
0
 protected ObjectChange(BaseObject ob)
 {
     this.Object = ob;
 }
Example #5
0
 public ObjectCreatedChange(BaseObject ob)
     : base(ob)
 {
 }
Example #6
0
 public ObjectCreatedChange(BaseObject ob)
     : base(ob)
 {
 }
Example #7
0
        /// <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;
        }
Example #8
0
 public bool IsController(BaseObject living)
 {
     return(m_controllables.Contains(living));
 }
Example #9
0
        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();
            }
        }
Example #10
0
 public PropertyIntChange(BaseObject ob, PropertyID propertyID, int value)
     : base(ob, propertyID)
 {
     this.Value = value;
 }
Example #11
0
 public PropertyStringChange(BaseObject ob, PropertyID propertyID, string value)
     : base(ob, propertyID)
 {
     this.Value = value;
 }
Example #12
0
 public PropertyValueChange(BaseObject ob, PropertyID propertyID, ValueType value)
     : base(ob, propertyID)
 {
     this.Value = value;
 }
Example #13
0
 protected PropertyChange(BaseObject ob, PropertyID propertyID)
     : base(ob)
 {
     this.PropertyID = propertyID;
 }
Example #14
0
 public ObjectDestructedChange(BaseObject ob)
     : base(ob)
 {
 }
Example #15
0
 public PropertyStringChange(BaseObject ob, PropertyID propertyID, string value)
     : base(ob, propertyID)
 {
     this.Value = value;
 }
Example #16
0
 public bool IsController(BaseObject living)
 {
     return m_controllables.Contains(living);
 }
Example #17
0
 public PropertyValueChange(BaseObject ob, PropertyID propertyID, ValueType value)
     : base(ob, propertyID)
 {
     this.Value = value;
 }
Example #18
0
 protected ObjectChange(BaseObject ob)
 {
     this.Object = ob;
 }