public MouseOverBlock(WorldPosition position, WorldManager manager, Map map, PlayerAvatar parent) : base(position, manager) { this.parent = parent; this.map = map; this.HasFixedPosition = false; }
protected Entity(WorldPosition position, WorldManager manager) { this.WorldManager = manager; this.Position = position; this.GroundFrictionScale_Experienced = 100f; this.GroundFrictionVelocity_Experienced = Vector3.Zero; this.DragVelocityExperienced = Vector3.Zero; }
protected override Entity makeEntity(EntitySchema schema, int chunkX, int chunkZ, WorldManager manager) { WorldPosition position = new WorldPosition( chunkX, chunkZ, schema.inChunkX, schema.inChunkY, schema.inChunkZ); switch (schema.TypeID) { case 0: return new ScootBlock(position, manager); case 1: return new SceneryEntity(position, manager); default: throw new NotImplementedException(); } }
public BillboardSetPiece(WorldPosition position, WorldManager manager) : base(position, manager) { }
public IEnumerable<Entity> GenerateAvailableEntities(int chunkX, int chunkZ, WorldManager manager) { lock (CacheLock) { //the following is a big block of checks to avoid if (!IsReady(chunkX, chunkZ)) yield break; int dist = Math.Abs(chunkX - IntendedCenterX) + Math.Abs(chunkZ - IntendedCenterZ); if (dist > EntitySpawnRadius) yield break; CacheData dat = this[chunkX, chunkZ]; if (dat.EntitiesSpawned) yield break; dat.Spawn(); foreach (Entity e in dat.Chunk.MakeGeneratedEntities(manager)) yield return e; } }
protected abstract Entity makeEntity(EntitySchema schema, int chunkX, int chunkZ, WorldManager manager);
public static Entity MakeEntity(EntitySchema schema, int chunkX, int chunkZ, WorldManager manager) { return instance.makeEntity(schema, chunkX, chunkZ, manager); }
protected override Entity makeEntity(EntitySchema schema, int chunkX, int chunkZ, WorldManager manager) { throw new NotImplementedException(); }
public ScootBlock(WorldPosition position, WorldManager manager) : base(position, manager) { intendedVelocity = new Vector3(1.5f, 0, 0); }
public WorldRenderer(Game game, WorldManager manager) : base(game) { WorldManager = manager; }
public SceneryEntity(WorldPosition pos, WorldManager manager) : base(pos, manager) { }
/// <summary> /// Generates all available (that is, within spawn range but not yet spawned) /// entities. /// </summary> /// <returns></returns> public IEnumerable<Entity> GenerateAllAvailableEntities(WorldManager manager) { for (int x = CenterChunkX - EntitySpawnRadius; x <= CenterChunkX + EntitySpawnRadius; x++) { for (int z = CenterChunkZ - EntitySpawnRadius; z <= CenterChunkZ + EntitySpawnRadius; z++) { foreach (Entity e in Cache.GenerateAvailableEntities(x, z, manager)) yield return e; } } }
public IEnumerable<Entity> MakeGeneratedEntities(WorldManager manager) { foreach (EntitySchema schema in entitySchemata) yield return EntityBuilder.MakeEntity(schema, chunkX, chunkZ, manager); }
public PlayerAvatar(WorldPosition position, WorldManager manager) : base(position, manager) { }