本文整理汇总了C#中wServer.realm.World类的典型用法代码示例。如果您正苦于以下问题:C# World类的具体用法?C# World怎么用?C# World使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
World类属于wServer.realm命名空间,在下文中一共展示了World类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddWorld
public static World AddWorld(World world)
{
world.Id = Interlocked.Increment(ref nextWorldId);
Worlds[world.Id] = world;
if (world is GameWorld)
Monitor.WorldAdded(world);
return world;
}
示例2: WorldClosed
public void WorldClosed(World world)
{
lock (worldLock)
{
var portal = portals[world];
nexus.LeaveWorld(portal);
portals.Remove(world);
}
}
示例3: AddWorld
public World AddWorld(World world)
{
if (world.Manager != null)
throw new InvalidOperationException("World already added.");
world.Id = Interlocked.Increment(ref nextWorldId);
Worlds[world.Id] = world;
OnWorldAdded(world);
return world;
}
示例4: HasPlayerNearby
public static bool HasPlayerNearby(World world, double x, double y)
{
foreach (var i in world.PlayersCollision.HitTest(x, y, 16))
{
var d = Dist(i.X, i.Y, x, y);
if (d < 16*16)
return true;
}
return false;
}
示例5: WorldClosed
public void WorldClosed(World world)
{
lock (worldLock)
{
Portal portal = portals[world];
nexus.LeaveWorld(portal);
portals.Remove(world);
log.InfoFormat("World {0}({1}) closed.", world.Id, world.Name);
}
}
示例6: Tick
public bool Tick(World world, RealmTime time)
{
remain -= time.thisTickTimes;
if (remain < 0)
{
cb(world, time);
return true;
}
return false;
}
示例7: WorldRemoved
public void WorldRemoved(World world)
{
//lock (worldLock)
//{
var portal = portals[world];
nexus.LeaveWorld(portal);
portals.Remove(world);
//}
}
示例8: Oryx
public void Oryx(World world, string text)
{
world.BroadcastPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "#Oryx the Mad God",
Text = text
}, null);
}
示例9: Oryx
public void Oryx(World world, string text)
{
world.BroadcastPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "#Oryx the Mad God",
Text = text.ToSafeText()
}, null);
logger.InfoFormat("[{0}({1})] <Oryx the Mad God> {2}", world.Name, world.Id, text);
}
示例10: BehaveWall
public void BehaveWall(Player killer, Wall w, World wallWorld)
{
this.Host = w;
BehaviorCondition cond = BehaviorCondition.OnDeath;
if (cond == BehaviorCondition.OnDeath)
{
wOwner = wallWorld;
var dat = new Tuple<Player, int>[]{
new Tuple<Player, int>(killer, 500)
};
Dictionary<Player, List<Item>> items = new Dictionary<Player, List<Item>>();
ProcessPublicBags(rand, dat);
ProcessSoulBags(rand, dat);
}
}
示例11: WorldAdded
public void WorldAdded(World world)
{
lock (worldLock)
{
var pos = GetRandPosition();
var portal = new Portal(0x0712, null)
{
Size = 80,
WorldInstance = world,
Name = world.Name
};
portal.Move(pos.X + 0.5f, pos.Y + 0.5f);
nexus.EnterWorld(portal);
portals.Add(world, portal);
}
}
示例12: WorldOpened
public void WorldOpened(World world)
{
lock (worldLock)
{
var pos = GetRandPosition();
var portal = new Portal(0x71c, null)
{
Size = 150,
WorldInstance = world,
Name = world.Name
};
portal.Move(pos.X, pos.Y);
nexus.EnterWorld(portal);
portals.Add(world, portal);
}
}
示例13: WorldAdded
public void WorldAdded(World world)
{
lock (worldLock)
{
Position pos = GetRandPosition();
var portal = new Portal(manager, 0x0712, null)
{
Size = 80,
WorldInstance = world,
Name = world.Name
};
portal.Move(pos.X + 0.5f, pos.Y + 0.5f);
nexus.EnterWorld(portal);
portals.Add(world, portal);
log.InfoFormat("World {0}({1}) added.", world.Id, world.Name);
}
}
示例14: WorldOpened
public void WorldOpened(World world)
{
lock (worldLock)
{
var pos = GetRandPosition();
var portal = new Portal(manager, 0x71c, null)
{
Size = 150,
WorldInstance = world,
Name = world.Name
};
portal.Move(pos.X, pos.Y);
nexus.EnterWorld(portal);
portals.Add(world, portal);
log.InfoFormat("World {0}({1}) opened.", world.Id, world.Name);
}
}
示例15: Tick
public bool Tick(World world, RealmTime time)
{
if (destroy)
{
world.Timers.Remove(this);
return true;
}
remain -= time.thisTickTimes;
if (remain < 0)
{
try
{
cb(world, time);
}
catch (Exception ex)
{
logger.Error(ex);
}
return true;
}
return false;
}