Ejemplo n.º 1
0
 public void AddTile(Point2 tilePoint, TileType tileType, float angle, bool horizontal, bool vertical)
 {
     if (this[tilePoint.X, tilePoint.Y] == null)
     {
         return;
     }
     AddTile(tilePoint, tileType);
     ArchitectRotationHandler.ApplyRotationFlip(this[tilePoint.X, tilePoint.Y].Transform, angle, horizontal, vertical);
 }
Ejemplo n.º 2
0
 public void AddTile(Point2 tilePoint, TileType tileType, int rotationFlags)
 {
     if (this[tilePoint.X, tilePoint.Y] == null)
     {
         return;
     }
     AddTile(tilePoint, tileType);
     ArchitectRotationHandler.ApplyFlipFlags(this[tilePoint.X, tilePoint.Y].Transform, rotationFlags);
 }
Ejemplo n.º 3
0
 private void readLayerLine(LayerData layer, int y, int lineWidth)
 {
     for (int x = 0; x < lineWidth; x++)
     {
         int      value         = readNextInt();
         int      id            = ArchitectRotationHandler.RemoveRotationFlags(value);
         int      rotationFlags = ArchitectRotationHandler.GetRotationFlags(value);
         Point2   position      = new Point2(x, y);
         TileType tileType      = null;
         if (id == 0)
         {
             continue;
         }
         tileType = linker.Tilesets[0][id - 1];
         layer.AddTile(position, tileType, rotationFlags);
     }
 }
Ejemplo n.º 4
0
 private void addLayer(LayerData layer)
 {
     fileContent += "Layer:" + layer.LayerTransform.name + "\n";
     fileContent += "Dimension:" + layer.LayerWidth + "," + layer.LayerHeight + ",\n";
     for (int y = layer.LayerHeight - 1; y >= 0; y--)
     {
         for (int x = 0; x < layer.LayerWidth; x++)
         {
             TileType tileType = layer[x, y].TileType;
             if (!tileType.IsNullOrIdZero())
             {
                 int rotationFlag = (int)ArchitectRotationHandler.getRotationFlipFlags(layer[x, y].Transform);
                 int id           = rotationFlag + layer[x, y].TileType.Id;
                 fileContent += id + ",";
             }
             else
             {
                 fileContent += 0 + ",";
             }
         }
         fileContent += "\n";
     }
 }