﻿<?xml version="1.0" encoding="UTF-8"?>
 <tileset version="1.10" tiledversion="1.11.0" name="fence_autotile" tilewidth="48" tileheight="48" tilecount="16" columns="4">
     <image source="fence_autotile.png" width="192" height="192" />

     <!-- FENCE AUTO-TILING using Wang Sets -->
     <wangsets>
         <wangset name="Fence Connections" type="edge" tile="-1">
             <wangcolor name="Fence" color="#ff0000" tile="-1" probability="1" />

             <!-- Row 1: Horizontal fence pieces -->
             <wangtile tileid="0" wangid="0,0,1,0,1,0,0,0" />
             <wangtile tileid="1" wangid="0,0,1,0,1,0,0,0" />
             <wangtile tileid="2" wangid="0,0,1,0,1,0,0,0" />
             <wangtile tileid="3" wangid="0,0,0,0,1,0,1,0" />

             <!-- Row 2: Vertical fence pieces -->
             <wangtile tileid="4" wangid="1,0,0,0,0,0,1,0" />
             <wangtile tileid="5" wangid="1,0,1,0,0,0,0,0" />
             <wangtile tileid="6" wangid="1,0,1,0,0,0,0,0" />
             <wangtile tileid="7" wangid="0,0,0,0,0,0,1,0" />

             <!-- Row 3: Corners -->
             <wangtile tileid="8" wangid="1,0,0,0,0,0,0,0" />
             <wangtile tileid="9" wangid="0,0,1,0,0,0,0,0" />
             <wangtile tileid="10" wangid="0,0,0,0,0,0,1,0" />
             <wangtile tileid="11" wangid="0,0,0,0,1,0,0,0" />

             <!-- Row 4: Junctions and gate -->
             <wangtile tileid="12" wangid="1,0,1,0,1,0,0,0" />
             <wangtile tileid="13" wangid="1,0,1,0,1,0,1,0" />
             <wangtile tileid="14" wangid="0,0,0,0,0,0,0,0" />
             <wangtile tileid="15" wangid="0,0,0,0,0,0,0,0" />
         </wangset>
     </wangsets>

     <!-- Individual tile properties -->
     <tile id="0">
         <properties>
             <property name="type" value="fence_horizontal_left" />
         </properties>
     </tile>
     <tile id="1">
         <properties>
             <property name="type" value="fence_horizontal_mid" />
         </properties>
     </tile>
     <tile id="2">
         <properties>
             <property name="type" value="fence_horizontal_mid2" />
         </properties>
     </tile>
     <tile id="3">
         <properties>
             <property name="type" value="fence_horizontal_right" />
         </properties>
     </tile>
     <tile id="4">
         <properties>
             <property name="type" value="fence_vertical_top" />
         </properties>
     </tile>
     <tile id="5">
         <properties>
             <property name="type" value="fence_vertical_mid" />
         </properties>
     </tile>
     <tile id="6">
         <properties>
             <property name="type" value="fence_vertical_mid2" />
         </properties>
     </tile>
     <tile id="7">
         <properties>
             <property name="type" value="fence_vertical_bottom" />
         </properties>
     </tile>
     <tile id="8">
         <properties>
             <property name="type" value="fence_corner_topleft" />
         </properties>
     </tile>
     <tile id="9">
         <properties>
             <property name="type" value="fence_corner_topright" />
         </properties>
     </tile>
     <tile id="10">
         <properties>
             <property name="type" value="fence_corner_bottomleft" />
         </properties>
     </tile>
     <tile id="11">
         <properties>
             <property name="type" value="fence_corner_bottomright" />
         </properties>
     </tile>
     <tile id="12">
         <properties>
             <property name="type" value="fence_tjunction" />
         </properties>
     </tile>
     <tile id="13">
         <properties>
             <property name="type" value="fence_cross" />
         </properties>
     </tile>
     <tile id="14">
         <properties>
             <property name="type" value="fence_gate_closed" />
             <property name="interactable" type="bool" value="true" />
         </properties>
     </tile>
     <tile id="15">
         <properties>
             <property name="type" value="fence_gate_open" />
             <property name="interactable" type="bool" value="true" />
         </properties>
     </tile>
 </tileset>
