#!/bin/bash

LIST=("custom.h"
"custom.c"
"geometry.h"
"geometry.c"
"input.h"
"input.c"
"main.c"
"player.h"
"player.c"
"shaders.h"
"shaders.c"
"sky.h"
"sky.c"
"terrain.h"
"terrain.c"
"water.h"
"water.c"
"fire.h"
"fire.c"
"text.h"
"text.c"
"network.h"
"network.c"
)

LIST2=(data/shaders/*)

D=$(date)
echo "$D" > linecount.txt

T=0
for((i=0;i<${#LIST[@]};i++)); do
    C=$(cat src/${LIST[$i]} | wc -l)
    echo "${LIST[$i]} : $C"
    echo "${LIST[$i]} : $C" >> linecount.txt
    T=$(( T+C ))
done
for((i=0;i<${#LIST2[@]};i++)); do
    #echo "${LIST2[$i]} : "
    C=$(cat ${LIST2[$i]} | wc -l)
    echo "${LIST2[$i]} : $C"
    echo "${LIST2[$i]} : $C" >> linecount.txt
    T=$(( T+C ))
done

echo ""
echo "total lines: $T"
echo "" >> linecount.txt
echo "total lines: $T" >> linecount.txt


# 4769 at time of checking ~Feb 21, 2025 awv
