1
0
Fork 0

Set up the {Location,Chunk}Reference classes.

This commit is contained in:
Starbeamrainbowlabs 2017-01-06 20:45:35 +00:00
parent c9bd9b3219
commit 4bd0ca9d8f
4 changed files with 34 additions and 3 deletions

View File

@ -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
);
}
}
}

View File

@ -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)
{
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}