mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
Set up the {Location,Chunk}Reference classes.
This commit is contained in:
parent
c9bd9b3219
commit
4bd0ca9d8f
4 changed files with 34 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Security.Policy;
|
||||
namespace Nibriboard.RippleSpace
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -11,8 +12,18 @@ namespace Nibriboard.RippleSpace
|
|||
/// </remarks>
|
||||
public class ChunkReference : Reference
|
||||
{
|
||||
public ChunkReference()
|
||||
public ChunkReference(Plane inPlane, int inX, int inY) : base(inPlane, inX, inY)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public LocationReference InPlanespace()
|
||||
{
|
||||
return new LocationReference(
|
||||
Plane,
|
||||
X / Plane.ChunkSize,
|
||||
Y / Plane.ChunkSize
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,9 @@ namespace Nibriboard.RippleSpace
|
|||
/// </summary>
|
||||
public class LocationReference : Reference
|
||||
{
|
||||
public LocationReference()
|
||||
public LocationReference(Plane inPlane, int inX, int inY) : base(inPlane, inX, inY)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
namespace Nibriboard.RippleSpace
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -6,8 +7,19 @@ namespace Nibriboard.RippleSpace
|
|||
/// </summary>
|
||||
public class Plane
|
||||
{
|
||||
public Plane()
|
||||
/// <summary>
|
||||
/// The size of the chunks on this plane.
|
||||
/// </summary>
|
||||
public readonly int ChunkSize;
|
||||
|
||||
/// <summary>
|
||||
/// The chunkspace that holds the currently loaded and active chunks.
|
||||
/// </summary>
|
||||
protected Dictionary<ChunkReference, Chunk> loadedChunkspace = new Dictionary<ChunkReference, Chunk>();
|
||||
|
||||
public Plane(int inChunkSize)
|
||||
{
|
||||
ChunkSize = inChunkSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,14 @@ namespace Nibriboard.RippleSpace
|
|||
/// </summary>
|
||||
public abstract class Reference
|
||||
{
|
||||
public readonly Plane Plane;
|
||||
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
|
||||
public Reference(Plane inPlane, int inX, int inY)
|
||||
{
|
||||
Plane = inPlane;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue