Ejemplo n.º 1
0
 public MabiPropBehavior(MabiProp prop, MabiPropFunc func = null)
 {
     this.Prop = prop;
     this.Func = func;
 }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
        /// <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;
        }
Ejemplo n.º 4
0
 /// <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));
 }
Ejemplo n.º 5
0
 /// <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);
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
        protected MabiProp SpawnProp(MabiProp prop, MabiPropFunc behavior = null)
        {
            WorldManager.Instance.AddProp(prop);
            if (behavior != null)
                this.DefineProp(prop, behavior);

            return prop;
        }
Ejemplo n.º 8
0
        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;
        }