本文整理汇总了C#中SMP.World类的典型用法代码示例。如果您正苦于以下问题:C# World类的具体用法?C# World怎么用?C# World使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
World类属于SMP命名空间,在下文中一共展示了World类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Server
public Server()
{
Log("Starting Server");
s = this;
consolePlayer = new ConsolePlayer(s);
consolePlayer.SetUsername(ConsoleName);
//Group.DefaultGroup = new DefaultGroup(); //debugging
mainlevel = new World(0, 127, 0, "main", new Random().Next());
World.worlds.Add(mainlevel);
ml = new MainLoop("server");
#region updatetimer
ml.Queue(delegate
{
updateTimer.Elapsed += delegate
{
Player.GlobalUpdate();
}; updateTimer.Start();
});
#endregion
//TODO AI Update Timer
//Setup();
Log("Server Started");
//new Creeper(new Point3(0, 0, 0), mainlevel);
}
示例2: Item
public Item(Items item, World l, bool inv = false)
{
isInventory = inv;
e = new Entity(this, l);
this.id = (short)item;
OnGround = false;
}
示例3: ChunkLoadQueue
public ChunkLoadQueue(int x, int z, bool unload, World world)
{
this.x = x;
this.z = z;
this.unload = unload;
this.world = world;
}
示例4: Use
public override void Use(Player p, params string[] args)
{
if (args.Length == 0) { Help(p); return; }
else if (args.Length == 1)
{
Random rand = new Random();
int seed = new Random().Next();
p.SendMessage("Creating world with seed: " + seed);
double x = 0; double y = 127; double z = 0;
World temp = new World(x, y, z, args[0], seed);
//while (Chunk.GetChunk((int)x, (int)z, temp).GetBlock((int)x, (int)(y - 1), (int)z) == 0)
// y--;
temp.SpawnY = y;
World.worlds.Add(temp);
p.SendMessage("World " + args[0] + " MADE!");
}
else if (args.Length == 2 || args.Length == 3)
{
int seed = Convert.ToInt32(args[1]);
p.SendMessage("Creating world with seed: " + seed);
double x = 0; double y = 127; double z = 0;
World temp = new World(x, y, z, args[0], seed);
if (args.Length == 3)
{
int limit = Convert.ToInt32(args[2]);
if (limit > 2)
temp.ChunkLimit = limit;
else { p.SendMessage("maxchunks cannot be less than 3. creating with maxchunks 3."); temp.ChunkLimit = 3; }
}
World.worlds.Add(temp);
p.SendMessage("World " + args[0] + " MADE!");
}
}
示例5: Physics
public Physics(World w, PSetting setting, int speed)
{
this.w = w;
this.setting = setting;
this.speed = speed;
this.random = new Random();
}
示例6: Creeper
public Creeper(Point3 pos, World level)
{
mye = new Entity(this, level);
mylevel = level;
e.pos = pos;
e.UpdateChunks(false, false);
}
示例7: ContainerChest
public ContainerChest(World level, Point3 point)
{
this.level = level;
this.point = point;
items = new Item[Size];
for (int i = 0; i < Size; i++)
items[i] = Item.Nothing;
}
示例8: ChunkGenQueue
public ChunkGenQueue(int x, int z, World world, bool generate = true, bool populate = true)
{
this.generate = generate;
this.populate = populate;
this.x = x;
this.z = z;
this.world = world;
}
示例9: Item
public Item(short item, byte count, short meta, World l)
{
this.item = (short)item;
this.meta = meta;
this.count = count;
OnGround = false;
e = new Entity(this, l);
}
示例10: WorldChunkManager
public WorldChunkManager(World world)
: this()
{
GenLayer[] agenlayer = GenLayer.func_35019_a(world.seed);
field_34907_a = agenlayer[0];
field_34906_b = agenlayer[1];
temperatureLayer = agenlayer[2];
rainfallLayer = agenlayer[3];
}
示例11: Entity
public Entity(AI ai, World l)
{
this.ai = ai;
id = FreeId();
isAI = true;
level = l;
Entities.Add(id, this);
}
示例12: Entity
public Entity(Player pl, World l)
: this(l)
{
p = pl;
isPlayer = true;
UpdateChunks(false, false);
Entities.Add(id, this);
}
示例13: Item
public Item(short item, byte count, short meta, World l, double[] pos, byte[] rot)
{
this.item = item;
this.count = count;
this.meta = meta;
this.level = l;
this.pos = pos;
this.rot = rot;
OnGround = true;
e = new Entity(this, l);
e.UpdateChunks(false, false);
}
示例14: Explosion
public Explosion(World world, /*Entity entity,*/ double d, double d1, double d2, float f)
{
isFlaming = false;
ExplosionRNG = new Random();
destroyedBlockPositions = new HashSet<Point3>();
worldObj = world;
//exploder = entity; // Not needed right now
explosionSize = f;
explosionX = d;
explosionY = d1;
explosionZ = d2;
}
示例15: Entity
public Entity(Item i, World l)
{
I = i;
if (!I.isInventory) id = FreeId();
isItem = true;
level = l;
if (!I.isInventory)
{
UpdateChunks(false, false);
Entities.Add(id, this);
}
}