usingDSharpPlus.Entities;usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Threading.Tasks;namespace IFE_0._3{abstractinternalclassVote{//Bro, here we're just gonna treat the ints as string so we can generalize this//Todo: Use Templates instead of this^//The key is what you're voting for, the int is how many times it's been votedprotectedDictionary<string,int> voteData =newDictionary<string, int>();//A list of the Votees with a bool attached as to weather or not they've voted yetprotectedDictionary<Player,bool> votees;//The interactable Buttons to send to playersList<DiscordComponent> buttons =newList<DiscordComponent>();int voteCount =0;bool finished =false;//Message to send at the start of the votestring gameChannelStartMessage ="";protectedMessanger messanger;//ConstructorpublicVote(List<Player> players,DiscordChannelgChannel,Messangermsgr){votees=newDictionary<Player, bool>();foreach(Playerplayerinplayers){votees.Add(player,false);}messanger=msgr;newDiscordMessageBuilder().WithContent(gameChannelStartMessage);populateButtons();sendButtons();}//Returns weather a vote has been cast or notpublicbooltestVote(Playerplayer){returnvotees[player];}//These two functions just create and send the Buttons to playerspublicabstractvoidsendButtons();publicabstractvoidpopulateButtons();//Casts vote publicvoidcastVote(stringkey,Playerplayer){if (voteData.TryGetValue(key,outvoteCount)){voteData[key]++;}else{voteData.Add(key,1);}if (voteOver()){voteFinish();}}//Checks weather or not the all players have votedboolvoteOver(){for (intx=0;x<votees.Count;x++){}boolvoteOverFlag=true;foreach(boolvotedinvotees.Values){if (!voted){voteOverFlag=false;}}returnvoteOverFlag;}//In the case of a tie, the vote will usually defer to captainprotectedvirtualstringbreakTie(Playercaptain){returncaptain.lastVote.ToString();}//What happens when the finishes and what to do with the resultpublicabstractvoidvoteFinish();}}