예제 #1
0
 /// <summary>
 /// Subscrives entered region.
 /// </summary>
 protected override void OnRegionEnter(Region region)
 {
     base.OnRegionEnter(region);
     // subscribibg to events relayed by region from it's items
     IDisposable messageReceiver = region.ItemEventChannel.Subscribe(this.peer.RequestFiber, this.Region_OnItemEvent);
     this.eventChannelSubscriptions[region] = messageReceiver;
 }
예제 #2
0
 /// <summary>
 ///   Override to include the <see cref = "Coordinate" /> for the <see cref = "MmoRadar" />.
 /// </summary>
 /// <param name = "position">
 ///   The position.
 /// </param>
 /// <param name = "region">
 ///   The region.
 /// </param>
 /// <returns>
 ///   An instance of <see cref = "MmoItemPositionUpdate" />.
 /// </returns>
 protected override ItemPositionMessage GetPositionUpdateMessage(Vector position, Region region)
 {
     return new MmoItemPositionUpdate(this, position, region, this.Coordinate);
 }
예제 #3
0
 /// <summary>
 /// Override to include the float[] coordinate for the <see cref="MmoRadar"/>.
 /// </summary>
 /// <param name="position">
 /// The position.
 /// </param>
 /// <param name="region">
 /// The region.
 /// </param>
 /// <returns>
 /// An instance of <see cref="MmoItemPositionUpdate"/>.
 /// </returns>
 protected override ItemPositionMessage GetPositionUpdateMessage(Vector position, Region region)
 {
     return new MmoItemPositionUpdate(this, position, region, this.Position.ToFloatArray());
 }
예제 #4
0
 /// <summary>
 /// Override to include the rotation and float[] coordinate on item subscribe.
 /// </summary>
 /// <param name="position">
 /// The position.
 /// </param>
 /// <param name="region">
 /// The region.
 /// </param>
 /// <returns>
 /// An instance of <see cref="MmoItemSnapshot"/>.
 /// </returns>
 protected override ItemSnapshot GetItemSnapshot(Vector position, Region region)
 {
     return new MmoItemSnapshot(this, position, region, this.PropertiesRevision, null, this.Position.ToFloatArray());
 }
예제 #5
0
 public ItemRegionChangedMessage(Region r0, Region r1, ItemSnapshot snaphot)
 {
     this.Region0 = r0;
     this.Region1 = r1;
     this.ItemSnapshot = snaphot;
 }
예제 #6
0
 public ItemSnapshot(Item source, Vector position, Vector rotation, Region worldRegion, int propertiesRevision)
 {
     this.Source = source;
     this.Position = position;
     this.Rotation = rotation;
     this.PropertiesRevision = propertiesRevision;
 }
예제 #7
0
 /// <summary>
 /// Unsubscribe exited region.
 /// </summary>
 protected override void OnRegionExit(Region region)
 {
     base.OnRegionExit(region);
     IDisposable messageReceiver = this.eventChannelSubscriptions[region];
     this.eventChannelSubscriptions.Remove(region);
     messageReceiver.Dispose();
 }