C# Class OpenMinecraft.Utils

Mostra file Open project: N3X15/MineEdit

Public Properties

Property Type Description
DungeonSizeX int
DungeonSizeY int
DungeonSizeZ int

Public Methods

Method Description
CheckForDungeonSpace ( byte b, int x, int y, int z ) : bool
CheckForTreeSpace ( byte &b, int x, int y, int z ) : bool
Clamp ( double val, double min, double max ) : double
Clamp ( float val, float min, float max ) : float
Clamp ( int val, int min, int max ) : int
Clamp ( long val, long min, long max ) : long
Clamp ( short val, short min, short max ) : short

Ensure value is between min and max.

CopyFlat ( string from, string to ) : void
CopyRecursive ( string sourceFolder, string destFolder ) : void
CosineInterpolate ( double y1, double y2, double mu ) : double
DirSize ( DirectoryInfo d ) : long
FillRect ( byte &b, byte blk, Vector3i position, Vector3i size ) : void
FixPlayerPlacement ( IMapHandler &mh ) : void
GetMD5HashFromFile ( string fileName ) : string

For FileSystemWatcher stuff

GrowCactus ( byte &b, Random rand, int x, int y, int z ) : void
GrowTree ( byte &b, Random r, int x, int y, int z ) : void
IntToBase ( int i, int radix ) : string
Lerp ( double a, double b, double u ) : double
Lerp ( float a, float b, float u ) : float

Used for blending colors or line-drawing.

Lerp ( int a, int b, int u ) : int
MakeDungeon ( int CX, int CZ, byte &b, IMapHandler &mh, Random r ) : bool

Generate a chunk

MakeDungeonWalls ( byte &b, Random r, Vector3i position, Vector3i size ) : void
PointOnCurve ( PointF p0, PointF p1, PointF p2, PointF p3, float t ) : PointF

Calculates interpolated point between two points using Catmull-Rom Spline

Points calculated exist on the spline between points two and three.

PointOnCurve ( Vector3d p0, Vector3d p1, Vector3d p2, Vector3d p3, double t ) : Vector3d

Calculates interpolated point between two points using Catmull-Rom Spline

Points calculated exist on the spline between points two and three.

UnixTimestamp ( ) : double

Private Methods

Method Description
FixLibnoiseOutput ( double p ) : double
GrowTreeFoliage ( byte &b, Random r, int x, int _y, int z, int height ) : void
GrowTreeTrunk ( byte &b, Random r, int x, int y, int z, int height ) : void
ObjectIsCompletelyUnderground ( byte b, Vector3i position, Vector3i size ) : bool
ObjectIsInChunk ( byte b, Vector3i position, Vector3i size ) : bool
ObjectIsIntersectingWithGround ( byte b, Vector3i position, Vector3i size ) : bool

Method Details

CheckForDungeonSpace() public static method

public static CheckForDungeonSpace ( byte b, int x, int y, int z ) : bool
b byte
x int
y int
z int
return bool

CheckForTreeSpace() public static method

public static CheckForTreeSpace ( byte &b, int x, int y, int z ) : bool
b byte
x int
y int
z int
return bool

Clamp() public static method

public static Clamp ( double val, double min, double max ) : double
val double
min double
max double
return double

Clamp() public static method

public static Clamp ( float val, float min, float max ) : float
val float
min float
max float
return float

Clamp() public static method

public static Clamp ( int val, int min, int max ) : int
val int
min int
max int
return int

Clamp() public static method

public static Clamp ( long val, long min, long max ) : long
val long
min long
max long
return long

Clamp() public static method

Ensure value is between min and max.
public static Clamp ( short val, short min, short max ) : short
val short value
min short
max short
return short

CopyFlat() public static method

public static CopyFlat ( string from, string to ) : void
from string
to string
return void

CopyRecursive() public static method

public static CopyRecursive ( string sourceFolder, string destFolder ) : void
sourceFolder string
destFolder string
return void

CosineInterpolate() public static method

public static CosineInterpolate ( double y1, double y2, double mu ) : double
y1 double
y2 double
mu double
return double

DirSize() public static method

public static DirSize ( DirectoryInfo d ) : long
d System.IO.DirectoryInfo
return long

FillRect() public static method

public static FillRect ( byte &b, byte blk, Vector3i position, Vector3i size ) : void
b byte
blk byte
position Vector3i
size Vector3i
return void

FixPlayerPlacement() public static method

public static FixPlayerPlacement ( IMapHandler &mh ) : void
mh IMapHandler
return void

GetMD5HashFromFile() public static method

For FileSystemWatcher stuff
public static GetMD5HashFromFile ( string fileName ) : string
fileName string
return string

GrowCactus() public static method

public static GrowCactus ( byte &b, Random rand, int x, int y, int z ) : void
b byte
rand System.Random
x int
y int
z int
return void

GrowTree() public static method

public static GrowTree ( byte &b, Random r, int x, int y, int z ) : void
b byte
r System.Random
x int
y int
z int
return void

IntToBase() public static method

public static IntToBase ( int i, int radix ) : string
i int
radix int
return string

Lerp() public static method

public static Lerp ( double a, double b, double u ) : double
a double
b double
u double
return double

Lerp() public static method

Used for blending colors or line-drawing.
public static Lerp ( float a, float b, float u ) : float
a float
b float
u float
return float

Lerp() public static method

public static Lerp ( int a, int b, int u ) : int
a int
b int
u int
return int

MakeDungeon() public static method

Generate a chunk
public static MakeDungeon ( int CX, int CZ, byte &b, IMapHandler &mh, Random r ) : bool
CX int Chunk X
CZ int Chunk Z
b byte Blocks
mh IMapHandler Map handler
r System.Random Random
return bool

MakeDungeonWalls() public static method

public static MakeDungeonWalls ( byte &b, Random r, Vector3i position, Vector3i size ) : void
b byte
r System.Random
position Vector3i
size Vector3i
return void

PointOnCurve() public static method

Calculates interpolated point between two points using Catmull-Rom Spline
Points calculated exist on the spline between points two and three.
public static PointOnCurve ( PointF p0, PointF p1, PointF p2, PointF p3, float t ) : PointF
p0 System.Drawing.PointF First Point
p1 System.Drawing.PointF Second Point
p2 System.Drawing.PointF Third Point
p3 System.Drawing.PointF Fourth Point
t float /// Normalised distance between second and third point /// where the spline point will be calculated ///
return System.Drawing.PointF

PointOnCurve() public static method

Calculates interpolated point between two points using Catmull-Rom Spline
Points calculated exist on the spline between points two and three.
public static PointOnCurve ( Vector3d p0, Vector3d p1, Vector3d p2, Vector3d p3, double t ) : Vector3d
p0 Vector3d First Point
p1 Vector3d Second Point
p2 Vector3d Third Point
p3 Vector3d Fourth Point
t double /// Normalised distance between second and third point /// where the spline point will be calculated ///
return Vector3d

UnixTimestamp() public static method

public static UnixTimestamp ( ) : double
return double

Property Details

DungeonSizeX public_oe static_oe property

public static int DungeonSizeX
return int

DungeonSizeY public_oe static_oe property

public static int DungeonSizeY
return int

DungeonSizeZ public_oe static_oe property

public static int DungeonSizeZ
return int