#textdomain wesnoth
# This file handles transitions involving bridges

#place the flags in the track hex so we can do all drawing later
#define LAYOUT_TRACKS_F SE_NW_VALUE N_S_VALUE NE_SW_VALUE FLAG
    # mark -connect- for colinear bridges
    {TRACK_CONNECT {SE_NW_VALUE} {FLAG} nw n ne se s sw 2 * * * * *}
    {TRACK_CONNECT {N_S_VALUE}   {FLAG} n ne se s sw nw * 2 * * * *}
    {TRACK_CONNECT {NE_SW_VALUE} {FLAG} ne se s sw nw n * * 2 * * *}
    {TRACK_CONNECT {SE_NW_VALUE} {FLAG} se s sw nw n ne * * * 2 * *}
    {TRACK_CONNECT {N_S_VALUE}   {FLAG} s sw nw n ne se * * * * 2 *}
    {TRACK_CONNECT {NE_SW_VALUE} {FLAG} sw nw n ne se s * * * * * 2}

    # mark -away- on sides where we should have exited but didnt
    {TRACK_AWAY {N_S_VALUE}   {SE_NW_VALUE} {FLAG} s  nw se n  sw ne 2 3 * * * *}
    {TRACK_AWAY {N_S_VALUE}   {NE_SW_VALUE} {FLAG} s  ne sw n  se nw * 3 2 * * *}
    {TRACK_AWAY {NE_SW_VALUE} {N_S_VALUE}   {FLAG} sw n  s  ne nw se * 2 3 * * *}
    {TRACK_AWAY {NE_SW_VALUE} {SE_NW_VALUE} {FLAG} sw se nw ne s  n  * * 3 2 * *}
    {TRACK_AWAY {SE_NW_VALUE} {NE_SW_VALUE} {FLAG} nw ne sw se n  s  * * 2 3 * *}
    {TRACK_AWAY {SE_NW_VALUE} {N_S_VALUE}   {FLAG} nw s  n  se sw ne * * * 3 2 *}
    {TRACK_AWAY {N_S_VALUE}   {SE_NW_VALUE} {FLAG} n  se nw s  ne sw * * * 2 3 *}
    {TRACK_AWAY {N_S_VALUE}   {NE_SW_VALUE} {FLAG} n  sw ne s  nw se * * * * 3 2}
    {TRACK_AWAY {NE_SW_VALUE} {N_S_VALUE}   {FLAG} ne s  n  sw se nw * * * * 2 3}
    {TRACK_AWAY {NE_SW_VALUE} {SE_NW_VALUE} {FLAG} ne nw se sw n  s  2 * * * * 3}
    {TRACK_AWAY {SE_NW_VALUE} {NE_SW_VALUE} {FLAG} se sw ne nw s  n  3 * * * * 2}
    {TRACK_AWAY {SE_NW_VALUE} {N_S_VALUE}   {FLAG} se n  s  nw ne sw 3 2 * * * *}

    # mark -connect- on all logically connected sides of bridges that are not -away-
    {TRACK_CONNECT_ALL {N_S_VALUE}   {FLAG} n ne se s sw nw * 2 * * * *}
    {TRACK_CONNECT_ALL {N_S_VALUE}   {FLAG} s sw nw n ne se * * * * 2 *}
    {TRACK_CONNECT_ALL {NE_SW_VALUE} {FLAG} ne se s sw nw n * * 2 * * *}
    {TRACK_CONNECT_ALL {NE_SW_VALUE} {FLAG} sw nw n ne se s * * * * * 2}
    {TRACK_CONNECT_ALL {SE_NW_VALUE} {FLAG} se s sw nw n ne * * * 2 * *}
    {TRACK_CONNECT_ALL {SE_NW_VALUE} {FLAG} nw n ne se s sw 2 * * * * *}

    # mark -connect- non logical sides of bridges who have a connect on the other side of hex
    {TRACK_FINAL ({N_S_VALUE},{NE_SW_VALUE},{SE_NW_VALUE}) {FLAG}}
#enddef

#define LAYOUT_TRACKS_STRAIGHT_F SE_NW_VALUE N_S_VALUE NE_SW_VALUE FLAG
    # mark -connect- for colinear bridges
    {TRACK_CONNECT {SE_NW_VALUE} {FLAG} nw n ne se s sw 2 * * * * *}
    {TRACK_CONNECT {N_S_VALUE}   {FLAG} n ne se s sw nw * 2 * * * *}
    {TRACK_CONNECT {NE_SW_VALUE} {FLAG} ne se s sw nw n * * 2 * * *}
    {TRACK_CONNECT {SE_NW_VALUE} {FLAG} se s sw nw n ne * * * 2 * *}
    {TRACK_CONNECT {N_S_VALUE}   {FLAG} s sw nw n ne se * * * * 2 *}
    {TRACK_CONNECT {NE_SW_VALUE} {FLAG} sw nw n ne se s * * * * * 2}

    # mark -connect- on all logically connected sides of bridges that are not -away-
    {TRACK_CONNECT_ALL {N_S_VALUE}   {FLAG} n ne se s sw nw * 2 * * * *}
    {TRACK_CONNECT_ALL {N_S_VALUE}   {FLAG} s sw nw n ne se * * * * 2 *}
    {TRACK_CONNECT_ALL {NE_SW_VALUE} {FLAG} ne se s sw nw n * * 2 * * *}
    {TRACK_CONNECT_ALL {NE_SW_VALUE} {FLAG} sw nw n ne se s * * * * * 2}
    {TRACK_CONNECT_ALL {SE_NW_VALUE} {FLAG} se s sw nw n ne * * * 2 * *}
    {TRACK_CONNECT_ALL {SE_NW_VALUE} {FLAG} nw n ne se s sw 2 * * * * *}
#enddef

#####################################################################################################
###############        AUTO GENERATED CODE        ###################################################
#####################################################################################################
