Removed dynamic settings
[entelect-challenge-tower-defence.git] / import-replay.sh
1 #!/bin/bash
2
3 set -e
4
5 REPLAY_FOLDER=$1
6 OUTPUT_FOLDER=$2
7
8 mkdir -p $OUTPUT_FOLDER
9
10 for round_folder in $REPLAY_FOLDER/*; do
11     round_name=`basename "$round_folder"`
12     mkdir -p "$OUTPUT_FOLDER/$round_name"
13
14     player_folders=( "$round_folder"/* )
15     player_folder=${player_folders[0]}
16     cp "$player_folder/JsonMap.json" "$OUTPUT_FOLDER/$round_name/state.json"
17     cp "$player_folder/PlayerCommand.txt" "$OUTPUT_FOLDER/$round_name/PlayerCommand.txt"
18     
19     opponent_folder=${player_folders[1]}
20     cp "$opponent_folder/PlayerCommand.txt" "$OUTPUT_FOLDER/$round_name/OpponentCommand.txt"
21 done