public void LoadEntites(Action <RuntimeTerraEntity[]> onComplete, Action <Exception> onError)
        {
            AssembledEntitySerializer serializer = new AssembledEntitySerializer();

            AssembledEntity[] entities = _db.Get <AssembledEntitySerializer, AssembledEntity>(
                serializer,
                "",
                $"SELECT {GetColumnSelectors(AssembledEntitySerializer.TerraEntitySerializer)},{GetColumnSelectors(AssembledEntitySerializer.TerraPosition3DSerializer)} " +
                $"FROM {AssembledEntitySerializer.TerraEntitySerializer.Table} " +
                $"LEFT OUTER JOIN {AssembledEntitySerializer.TerraPosition3DSerializer.Table} " +
                $"ON {AssembledEntitySerializer.TerraEntitySerializer.Table}.{TerraEntitySerializer.COLUMN_INSTNACE_ID} = {AssembledEntitySerializer.TerraPosition3DSerializer.Table}.{TerraEntitySerializer.COLUMN_INSTNACE_ID}");

            RuntimeTerraEntity[] runtimeEntities = new RuntimeTerraEntity[entities.Length];

            for (int i = 0; i < entities.Length; i++)
            {
                runtimeEntities[i] = new RuntimeTerraEntity(entities[i], _db);
            }

            onComplete(runtimeEntities);
        }
        public void LoadEntities(TerraArea area, Action <RuntimeTerraEntity[]> onComplete, Action onError)
        {
            AssembledEntitySerializer serializer = new AssembledEntitySerializer();

            string posTable = AssembledEntitySerializer.TerraPosition3DSerializer.Table;

            AssembledEntity[] entities = _db.Get <AssembledEntitySerializer, AssembledEntity>(
                serializer,
                "",
                $"SELECT {GetColumnSelectors(AssembledEntitySerializer.TerraEntitySerializer)},{GetColumnSelectors(AssembledEntitySerializer.TerraPosition3DSerializer)} " +
                $"FROM {AssembledEntitySerializer.TerraEntitySerializer.Table} " +
                $"LEFT OUTER JOIN {AssembledEntitySerializer.TerraPosition3DSerializer.Table} " +
                $"ON {AssembledEntitySerializer.TerraEntitySerializer.Table}.{TerraEntitySerializer.COLUMN_INSTNACE_ID} = {AssembledEntitySerializer.TerraPosition3DSerializer.Table}.{TerraEntitySerializer.COLUMN_INSTNACE_ID} " +
                $"WHERE {posTable}.x > {area.x} AND {posTable}.x < {area.x + area.width} AND {posTable}.y > {area.y} AND {posTable}.y < {area.y + area.height}");

            RuntimeTerraEntity[] runtimeEntities = new RuntimeTerraEntity[entities.Length];

            for (int i = 0; i < entities.Length; i++)
            {
                runtimeEntities[i] = new RuntimeTerraEntity(entities[i], _db);
            }

            onComplete(runtimeEntities);
        }