public long PushReturnValue(IValue value) { long id = _IdLandlord.Rent(); _ReturnValues.Add(id, value); return(id); }
private long _RegisterUnsupply(PassageCallback passage) { long id = _UnsupplyIdLandlord.Rent(); _UnsupplyPassages.Add(new SoulPassage(id, passage)); return(id); }
private Soul _NewSoul(object soul, Type soul_type) { MemberMap map = _Protocol.GetMemberMap(); int interfaceId = map.GetInterface(soul_type); Soul newSoul = new Soul(_IdLandlord.Rent(), interfaceId, soul_type, soul); // property PropertyInfo[] propertys = soul_type.GetProperties(BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public); for (int i = 0; i < propertys.Length; ++i) { PropertyInfo property = propertys[i]; int id = map.GetProperty(property); if (property.PropertyType.GetInterfaces().Any(t => t == typeof(IDirtyable))) { object propertyValue = property.GetValue(soul); IDirtyable dirtyable = propertyValue as IDirtyable; PropertyUpdater pu = new PropertyUpdater(dirtyable, id); newSoul.AddPropertyUpdater(pu); } } _Souls.Add(newSoul); return(newSoul); }
public long Add(Delegate value) { long id = _IdLandlord.Rent(); _Runners.Add(new Invoker() { Id = id, Runner = value }); return(id); }
private SoulProxy _NewSoul(object soul, Type soul_type) { int interfaceId = _Protocol.GetMemberMap().GetInterface(soul_type); var newSoul = new SoulProxy(_IdLandlord.Rent(), interfaceId, soul_type, soul); newSoul.SupplySoulEvent += _PropertyBind; newSoul.UnsupplySoulEvent += _PropertyUnbind; Regulus.Utility.Log.Instance.WriteInfo($"soul add {newSoul.Id}:{soul_type.Name}."); _Souls.TryAdd(newSoul.Id, newSoul); return(newSoul); }