private void AddObject(ToffeeObject tObject) { if (tObject.Network != this) { throw new ToffeeException("Tried to add object to network '{0}' but object belongs to '{1}'", Name, tObject.Network.Name); } if (Objects.ContainsKey(tObject.GetType())) { Objects[tObject.GetType()].Add(tObject); ObjectIdentifierLookup[tObject.GetType()].Add(tObject.FullName, tObject); ObjectLookup[tObject.GetType()].Add(tObject.ObjectId, tObject); } else { Objects.Add(tObject.GetType(), new List <ToffeeObject>()); ObjectIdentifierLookup.Add(tObject.GetType(), new Dictionary <string, ToffeeObject>()); ObjectLookup.Add(tObject.GetType(), new Dictionary <uint, ToffeeObject>()); Objects[tObject.GetType()].Add(tObject); ObjectIdentifierLookup[tObject.GetType()].Add(tObject.FullName, tObject); ObjectLookup[tObject.GetType()].Add(tObject.ObjectId, tObject); } }
public ToffeeProperty(ToffeeObject owner, PropertyInfo propertyInfo, ToffeeModifiers modifiers) : base(owner, propertyInfo.Name, modifiers) { PropertyInfo = propertyInfo; }
public ToffeeField(ToffeeObject owner, string identifier, ToffeeModifiers modifiers = ToffeeModifiers.None) { Owner = owner; Identifier = identifier; Modifiers = modifiers; }
public ToffeeMethod(ToffeeObject owner, MethodInfo methodInfo, ToffeeModifiers modifiers = ToffeeModifiers.None) : base(owner, methodInfo.Name, modifiers) { MethodInfo = methodInfo; Parameters = MethodInfo.GetParameters().Select(p => p.ParameterType).ToArray(); }