mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-08 03:24:45 +00:00
format everything
This commit is contained in:
@@ -8,32 +8,32 @@ class Biome;
|
||||
|
||||
class Arrays {
|
||||
public:
|
||||
static void fill(std::vector<double>& arr, unsigned int from, unsigned int to,
|
||||
double value) {
|
||||
static void fill(std::vector<double>& arr, unsigned int from,
|
||||
unsigned int to, double value) {
|
||||
assert(from >= 0);
|
||||
assert(from <= to);
|
||||
assert(to <= arr.size());
|
||||
std::fill(arr.data() + from, arr.data() + to, value);
|
||||
}
|
||||
|
||||
static void fill(std::vector<float>& arr, unsigned int from, unsigned int to,
|
||||
float value) {
|
||||
static void fill(std::vector<float>& arr, unsigned int from,
|
||||
unsigned int to, float value) {
|
||||
assert(from >= 0);
|
||||
assert(from <= to);
|
||||
assert(to <= arr.size());
|
||||
std::fill(arr.data() + from, arr.data() + to, value);
|
||||
}
|
||||
|
||||
static void fill(std::vector<Biome*>& arr, unsigned int from, unsigned int to,
|
||||
Biome* value) {
|
||||
static void fill(std::vector<Biome*>& arr, unsigned int from,
|
||||
unsigned int to, Biome* value) {
|
||||
assert(from >= 0);
|
||||
assert(from <= to);
|
||||
assert(to <= arr.size());
|
||||
std::fill(arr.data() + from, arr.data() + to, value);
|
||||
}
|
||||
|
||||
static void fill(std::vector<uint8_t>& arr, unsigned int from, unsigned int to,
|
||||
uint8_t value) {
|
||||
static void fill(std::vector<uint8_t>& arr, unsigned int from,
|
||||
unsigned int to, uint8_t value) {
|
||||
assert(from >= 0);
|
||||
assert(from <= to);
|
||||
assert(to <= arr.size());
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Buffer.h"
|
||||
#include "console_helpers/Definitions.h" // 4jcraft TODO
|
||||
#include "console_helpers/Definitions.h" // 4jcraft TODO
|
||||
|
||||
class IntBuffer;
|
||||
class FloatBuffer;
|
||||
|
||||
@@ -12,8 +12,8 @@ private:
|
||||
OutputStream* stream;
|
||||
|
||||
protected:
|
||||
std::vector<uint8_t> buf; // The internal buffer where data is stored.
|
||||
unsigned int count; // The number of valid bytes in the buffer.
|
||||
std::vector<uint8_t> buf; // The internal buffer where data is stored.
|
||||
unsigned int count; // The number of valid bytes in the buffer.
|
||||
|
||||
public:
|
||||
BufferedOutputStream(OutputStream* out, int size);
|
||||
@@ -21,7 +21,8 @@ public:
|
||||
|
||||
virtual void flush();
|
||||
virtual void close();
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length);
|
||||
virtual void write(const std::vector<uint8_t>& b);
|
||||
virtual void write(unsigned int b);
|
||||
};
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
class ByteArrayInputStream : public InputStream {
|
||||
protected:
|
||||
std::vector<uint8_t> buf; // An array of bytes that was provided by the creator of the
|
||||
// stream.
|
||||
std::vector<uint8_t> buf; // An array of bytes that was provided by the
|
||||
// creator of the stream.
|
||||
unsigned int count; // The index one greater than the last valid character
|
||||
// in the input stream buffer.
|
||||
unsigned int mark; // The currently marked position in the stream.
|
||||
@@ -23,7 +23,8 @@ public:
|
||||
virtual ~ByteArrayInputStream();
|
||||
virtual int read();
|
||||
virtual int read(std::vector<uint8_t>& b);
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length);
|
||||
virtual void close();
|
||||
virtual int64_t skip(int64_t n);
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <cstdint>
|
||||
|
||||
class ByteArrayOutputStream : public OutputStream {
|
||||
// Note - when actually implementing, std::vector<uint8_t> will need to grow as data is
|
||||
// written
|
||||
// Note - when actually implementing, std::vector<uint8_t> will need to grow
|
||||
// as data is written
|
||||
public:
|
||||
std::vector<uint8_t> buf; // The buffer where data is stored.
|
||||
|
||||
@@ -22,7 +22,8 @@ public:
|
||||
virtual void flush() {}
|
||||
virtual void write(unsigned int b);
|
||||
virtual void write(const std::vector<uint8_t>& b);
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length);
|
||||
virtual void close();
|
||||
virtual std::vector<uint8_t> toByteArray();
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ class DataInput {
|
||||
public:
|
||||
virtual int read() = 0;
|
||||
virtual int read(std::vector<uint8_t>& b) = 0;
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset, unsigned int length) = 0;
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length) = 0;
|
||||
virtual bool readBoolean() = 0;
|
||||
virtual uint8_t readByte() = 0;
|
||||
virtual unsigned char readUnsignedByte() = 0;
|
||||
|
||||
@@ -16,7 +16,8 @@ public:
|
||||
DataInputStream(InputStream* in);
|
||||
virtual int read();
|
||||
virtual int read(std::vector<uint8_t>& b);
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length);
|
||||
virtual void close();
|
||||
virtual bool readBoolean();
|
||||
virtual uint8_t readByte();
|
||||
|
||||
@@ -23,7 +23,8 @@ public:
|
||||
|
||||
virtual void write(unsigned int b);
|
||||
virtual void write(const std::vector<uint8_t>& b);
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length);
|
||||
virtual void close();
|
||||
virtual void writeByte(uint8_t a);
|
||||
virtual void writeDouble(double a);
|
||||
|
||||
@@ -14,7 +14,8 @@ public:
|
||||
virtual ~FileInputStream();
|
||||
virtual int read();
|
||||
virtual int read(std::vector<uint8_t>& b);
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length);
|
||||
virtual void close();
|
||||
virtual int64_t skip(int64_t n);
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ public:
|
||||
virtual ~FileOutputStream();
|
||||
virtual void write(unsigned int b);
|
||||
virtual void write(const std::vector<uint8_t>& b);
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length);
|
||||
virtual void close();
|
||||
virtual void flush();
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ public:
|
||||
GZIPInputStream(InputStream* out) : stream(out) {};
|
||||
virtual int read() { return stream->read(); };
|
||||
virtual int read(std::vector<uint8_t>& b) { return stream->read(b); };
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset, unsigned int length) {
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length) {
|
||||
return stream->read(b, offset, length);
|
||||
};
|
||||
virtual void close() { return stream->close(); };
|
||||
|
||||
@@ -12,7 +12,8 @@ public:
|
||||
GZIPOutputStream(OutputStream* out) : stream(out) {};
|
||||
virtual void write(unsigned int b) { stream->write(b); };
|
||||
virtual void write(const std::vector<uint8_t>& b) { stream->write(b); };
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset, unsigned int length) {
|
||||
virtual void write(const std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length) {
|
||||
stream->write(b, offset, length);
|
||||
};
|
||||
virtual void close() { stream->close(); };
|
||||
|
||||
@@ -12,7 +12,8 @@ public:
|
||||
|
||||
virtual int read() = 0;
|
||||
virtual int read(std::vector<uint8_t>& b) = 0;
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset, unsigned int length) = 0;
|
||||
virtual int read(std::vector<uint8_t>& b, unsigned int offset,
|
||||
unsigned int length) = 0;
|
||||
virtual void close() = 0;
|
||||
virtual int64_t skip(int64_t n) = 0;
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@ class Biome;
|
||||
class Node;
|
||||
|
||||
// 4J Jev, just thought it would be easier this way.
|
||||
#define ArrayCopyFunctionDeclaration(x) \
|
||||
static void arraycopy(const std::vector<x>& src, unsigned int srcPos, \
|
||||
std::vector<x>* dst, unsigned int dstPos, \
|
||||
#define ArrayCopyFunctionDeclaration(x) \
|
||||
static void arraycopy(const std::vector<x>& src, unsigned int srcPos, \
|
||||
std::vector<x>* dst, unsigned int dstPos, \
|
||||
unsigned int length);
|
||||
#define ArrayCopyFunctionDefinition(x) \
|
||||
void System::arraycopy(const std::vector<x>& src, unsigned int srcPos, \
|
||||
std::vector<x>* dst, unsigned int dstPos, \
|
||||
unsigned int length) { \
|
||||
arraycopy<x>(src, srcPos, dst, dstPos, length); \
|
||||
#define ArrayCopyFunctionDefinition(x) \
|
||||
void System::arraycopy(const std::vector<x>& src, unsigned int srcPos, \
|
||||
std::vector<x>* dst, unsigned int dstPos, \
|
||||
unsigned int length) { \
|
||||
arraycopy<x>(src, srcPos, dst, dstPos, length); \
|
||||
}
|
||||
|
||||
class System {
|
||||
|
||||
Reference in New Issue
Block a user