Initial implementation
This commit is contained in:
1 parent
fa838c1a7f
commit
93632f45fb
12 files changed
+257
No files matched your search
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CubicNoise.Contracts;
|
||||
|
||||
namespace CubicNoise.Noisers
|
||||
{
|
||||
public sealed class CubicNoiseEngine : INoiseEngine
|
||||
{
|
||||
private Dictionary<IParameterName, int> intParameters;
|
||||
private int seed;
|
||||
|
||||
public CubicNoiseEngine(int seed, Dictionary<IParameterName, int> intParameters)
|
||||
{
|
||||
this.intParameters = intParameters;
|
||||
this.seed = seed;
|
||||
}
|
||||
|
||||
public float Get(float x)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public float Get(float x, float y)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CubicNoise.Builders;
|
||||
using CubicNoise.Contracts;
|
||||
|
||||
namespace CubicNoise.Noisers
|
||||
{
|
||||
public class CubicNoiseIntParameters : IParameterName
|
||||
{
|
||||
public static readonly IParameterName OCTAVE = new CubicNoiseIntParameters();
|
||||
public static readonly IParameterName PERIOD_X = new CubicNoiseIntParameters();
|
||||
public static readonly IParameterName PERIOD_Y = new CubicNoiseIntParameters();
|
||||
|
||||
private CubicNoiseIntParameters()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Text;
|
||||
using CubicNoise.Builders;
|
||||
using CubicNoise.Contracts;
|
||||
|
||||
namespace CubicNoise.Noisers
|
||||
{
|
||||
public sealed class CubicNoiseParameterKinds
|
||||
{
|
||||
private CubicNoiseParameterKinds()
|
||||
{
|
||||
}
|
||||
|
||||
public static CubicNoiseParameterKinds Int { get; } = new CubicNoiseParameterKinds();
|
||||
|
||||
public IParameterName Use(CubicNoiseIntParameters name) => name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CubicNoise.Contracts;
|
||||
|
||||
namespace CubicNoise.Noisers
|
||||
{
|
||||
public sealed class RandomNumberEngine : INoiseEngine
|
||||
{
|
||||
private Random rng;
|
||||
|
||||
public RandomNumberEngine(int seed)
|
||||
{
|
||||
this.rng = new Random(seed);
|
||||
}
|
||||
|
||||
public float Get(float x)
|
||||
{
|
||||
return this.rng.Next();
|
||||
}
|
||||
|
||||
public float Get(float x, float y)
|
||||
{
|
||||
return this.rng.Next();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user