1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[server] Make *Reference classes implement ICloneable

This commit is contained in:
Starbeamrainbowlabs 2017-05-01 14:38:57 +01:00
parent 451b3a0171
commit 2e97f91efe
3 changed files with 21 additions and 1 deletions

View file

@ -90,5 +90,14 @@ namespace Nibriboard.RippleSpace
y y
); );
} }
/// <summary>
/// Returns a clone of this ChunkReference.
/// </summary>
/// <returns>The newly-cloned instance.</returns>
public override object Clone()
{
return new ChunkReference(Plane, X, Y);
}
} }
} }

View file

@ -67,5 +67,14 @@ namespace Nibriboard.RippleSpace
y y
); );
} }
/// <summary>
/// Returns a clone of this LocationReference.
/// </summary>
/// <returns>The newly-cloned instance.</returns>
public override object Clone()
{
return new LocationReference(Plane, X, Y);
}
} }
} }

View file

@ -5,7 +5,7 @@ namespace Nibriboard.RippleSpace
/// <summary> /// <summary>
/// An abstract class representing a coordinate reference to a location. /// An abstract class representing a coordinate reference to a location.
/// </summary> /// </summary>
public abstract class Reference public abstract class Reference : ICloneable
{ {
public readonly Plane Plane; public readonly Plane Plane;
@ -22,5 +22,7 @@ namespace Nibriboard.RippleSpace
{ {
return $"({X}, {Y}, {Plane.Name})"; return $"({X}, {Y}, {Plane.Name})";
} }
public abstract object Clone();
} }
} }