public MabiPropBehavior(MabiProp prop, MabiPropFunc func = null) { this.Prop = prop; this.Func = func; }
/// <summary> /// Spawns prop with the specified behavior, using the region name. /// </summary> protected MabiProp SpawnProp(uint propClass, string region, uint x, uint y, float direction, float scale, MabiPropFunc behavior) { uint regionId = MabiData.RegionDb.TryGetRegionId(region); return this.SpawnProp(propClass, regionId, x, y, scale, direction, behavior); }
/// <summary> /// Spawns prop with the specified behavior, using the region id. /// </summary> protected MabiProp SpawnProp(uint propClass, uint region, uint x, uint y, float direction, float scale, MabiPropFunc behavior) { var prop = this.SpawnProp(propClass, region, x, y, direction, scale); this.DefineProp(prop, behavior); return prop; }
/// <summary> /// Adds the given prop and behavior to the behavior list. /// </summary> protected void DefineProp(MabiProp prop, MabiPropFunc behavior = null) { if (behavior != null) WorldManager.Instance.SetPropBehavior(new MabiPropBehavior(prop, behavior)); }
/// <summary> /// Adds a behavior for the prop with the given id. Since this is for /// client side props we also need a location that can be checked later on. /// </summary> protected void DefineProp(ulong propId, uint region, uint x, uint y, MabiPropFunc behavior = null) { this.DefineProp(new MabiProp(propId, region, x, y), behavior); }
protected void DefineProp(ulong propId, string region, uint x, uint y, MabiPropFunc behavior = null) { uint regionId = MabiData.RegionDb.TryGetRegionId(region); this.DefineProp(propId, regionId, x, y, behavior); }
protected MabiProp SpawnProp(MabiProp prop, MabiPropFunc behavior = null) { WorldManager.Instance.AddProp(prop); if (behavior != null) this.DefineProp(prop, behavior); return prop; }
protected MabiProp SpawnProp(ulong id, string name, string title, string extra, uint propClass, uint region, uint x, uint y, float direction, float scale, MabiPropFunc behavior) { var prop = new MabiProp(id, name, title, extra, propClass, region, x, y, direction, scale); WorldManager.Instance.AddProp(prop); if (behavior != null) this.DefineProp(prop, behavior); return prop; }