Ejemplo n.º 1
0
 public MouseOverBlock(WorldPosition position, WorldManager manager, Map map, PlayerAvatar parent)
     : base(position, manager)
 {
     this.parent = parent;
     this.map = map;
     this.HasFixedPosition = false;
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
 public BillboardSetPiece(WorldPosition position, WorldManager manager)
     : base(position, manager)
 {
 }
Ejemplo n.º 5
0
        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;
            }
        }
Ejemplo n.º 6
0
 protected abstract Entity makeEntity(EntitySchema schema, int chunkX, int chunkZ, WorldManager manager);
Ejemplo n.º 7
0
 public static Entity MakeEntity(EntitySchema schema, int chunkX, int chunkZ, WorldManager manager)
 {
     return instance.makeEntity(schema, chunkX, chunkZ, manager);
 }
Ejemplo n.º 8
0
 protected override Entity makeEntity(EntitySchema schema, int chunkX, int chunkZ, WorldManager manager)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 9
0
 public ScootBlock(WorldPosition position, WorldManager manager)
     : base(position, manager)
 {
     intendedVelocity = new Vector3(1.5f, 0, 0);
 }
Ejemplo n.º 10
0
 public WorldRenderer(Game game, WorldManager manager)
     : base(game)
 {
     WorldManager = manager;
 }
Ejemplo n.º 11
0
 public SceneryEntity(WorldPosition pos, WorldManager manager)
     : base(pos, manager)
 {
 }
Ejemplo n.º 12
0
 /// <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;
         }
     }
 }
Ejemplo n.º 13
0
 public IEnumerable<Entity> MakeGeneratedEntities(WorldManager manager)
 {
     foreach (EntitySchema schema in entitySchemata)
         yield return EntityBuilder.MakeEntity(schema, chunkX, chunkZ, manager);
 }
Ejemplo n.º 14
0
 public PlayerAvatar(WorldPosition position, WorldManager manager)
     : base(position, manager)
 {
 }