Пример #1
0
        protected void Remove(object Obj)
        {
            if (!NetworkedObjects.ContainsKey(Obj))
            {
                throw new InvalidOperationException("Could not remove an object which does not exist");
            }

            NetworkedObjects.Remove(Obj);
            PropertyHooks.Unhook(Obj);
        }
Пример #2
0
        protected void Add(object Obj, int ID)
        {
            if (NetworkedObjects.ContainsKey(Obj))
            {
                throw new InvalidOperationException("Could not add an object which already exists");
            }

            ObjectNetworkedProperties Props;

            if (this is Server)
            {
                Props = PropertyHooks.Hook(Obj, SetOverrideServer);
            }
            else
            {
                Props = PropertyHooks.Hook(Obj, SetOverrideClient);
            }

            NetworkedObjects.Add(Obj, new NetworkedObject(Obj, ID, Props));
        }