Created by Daniel Kravec, on June 1st, 2022
This is a project to help me learn C#, so the code may not be perfect. And some earlier commits may be confusing compared to what the final project with be, since i would be testing random stuff.
Run "dotnet run" in the terminal with the project root folder as your entry point. this will automatically run Program.cs
- created base program.
- created a "Deck" class (also helped with learning classes in c#).
- this will be used to keep data and functions to change those data easier.
- created layout for drawcards, which will be the terminal screen eventually.
- The program basically does nothing at this moment.
- class Program (updated).
- Renamed Deck to myDeck (from myObj).
- Created a WriteConsole function, which writes to the console in colour.
- Created function characterWriteTest, prints every possiblie colour for the console. (Commented out function)
- listens for your input.
- a goes to a saved game (eventually).
- enter goes to a new game (eventually).
- you can press escape (even from in game) and it will show a menu (eventually...).
- created NewGame function.
- runs after pressing Enter.
- calucate cards, shuffles, then saves one card to json file, then shows every single card in the console.
- struct CardType (new).
- how cards are stored in a deck.
- class Deck (updated).
- created a function that calucates the cards in a deck.
- created a function that shuffles the cards in the deck (you can even add more cards later on).
- Commented extra Deck data and functions that didnt need to be saved (colour, numCards, numDeck).
- Created CheckCardColour function (even though it should have it already, i might remove the function later).
- class SaveDataType (new).
- created functions to save and read data (currently for just one card).
- Data can now be saved to /saves/saveData.json (for now, only saves first card in your shuffled deck).
- other.
- added /saves to .gitignore.
- started dividing classes and types from the main file (Deck and CardType).
- Moved SaveDataType into a new file (in /classes).
- Renamed /types to /structs.
- added DeckJsonType.cs, to convert the Deck class into a json saveable object.
- Now saves entire deck data to saveData.json.
- Removed Deck.Run function.
- Removed extra commented out code from every file.
- Added GameLoop function, to test once its ready. (Loops every 1s)
- Created new GameDataType (from comments in Program.cs).
- Commented out call to GameLoop function.
- Updated GameLoop to tell which frame you are currently on.
- Where the function checks for escape button, program also checks for user movement.
- created drawCards function.
- It is a prototype, it draws cards on points on the terminal.
- Created new class, User.
- 2 functions, GetGridSize, MoveSelect.
- GetGridSize function checks your terminal size.
- MoveSelect checks your input prevously, and moves accordingly.
- Rewrote /classes/User.cs (then commented, then reworked).
- Created a border around the terminal, and stores the coordinates of each wall.
- Created a new function that checks the coordinates of the wall, and checks if you ran into it.
- Currently only the right side is not working.
- Created new /structs/borderLocationType.cs, made it easier to save the data of the walls.
- Removed extra comments.
- Fixed problem where it wouldnt understand the border on the left side. it was due to me not adding a -1 in the coordinate of the border itself.
- Removed /saves from .gitignore, and replaced with /saves/* (when you run without the folder, it crashes)
- GetGridSize returns a Boolean to check if the grid remained the same size as last requested.
- Now only creates the border when the grid changed size.
- Removed myUser.GetGridSize from Program.cs. (unrequired)
- Escape will now always be working when pressing Escape.
- Created new Layout.cs.
- Draws the deck, and discard pile.
- Will keep in place where piles are.
- function to draw a card in the discard.
- Game draws deck, discard.
- In the main loop, it will now check if you pressed enter.
- if you are where deck is, it will add a card in discard pile.
- At gameTitle, it shows the card types with icons.
- added CalucateHandout in deck.cs.
- it should calucate your handout (but it might not work, untested).
- Added type HandoutType.
- keeps track of your layers in handout.
- Created a new War game option.
- WarGame Class.
- StartWarGame(), starts the game, and sets the deck and shuffles.
- GameLoopWar(), which will draw new cards.
- Handout(), attempts to divide cards to the different users (currently not finished)
- formatCard(), which will be used once cards are drawn on screen.
- Played around with setting methods of setting values.
- Changed WarLayout from arrays to Lists.
- unsuccessful.
- Successfully added cards to Users WarLayout on handout.
- Saves PrepareHandout to Global WarHandout.
- More commented testing.
- Cleaned up testing code for dealing cards.
- added drawPlayerCards, gets the last card in the list, and saves it.
- Added CurrentWar, which will keep track of cards and war.
- added CheckWhoWins, not completed, but it will check the lastest played card.
- Handout() now prepares the war as well.
- added currentlyPlaying to warLayout.
- Updated GameLoopWar, it now checks for when you press enter, and runs drawPlayerCards().
- drawPlayerCards
- will check if your count is greater than 0
- then run DiscardToDeck(), otherwise it will draw the card (not on the console but in a draw deck).
- runs moveCardToDiscard after drawing a card.
- created moveCardToDiscard(), saves drawn card to discard pile, if deck is empty after ran, runs DiscardToDeck().
- updated CheckWhoWins(), (not completed), adds to an array and runs over that array and will later check who has the higher card.
- created convertCardtoNum(), will convert the card to a number, so its easier to check who won.
- created DiscardToDeck(), it will shuffle the discard and copy the list to the user deck.
- Prepares discardpile when dealing cards.
- updated CurrentWar struct, to have drawnCardsWar, for the current war.
- updated WarLayout, added userID, and location. (both unused)
- cleaned up war code, removed extra console logs.
- fixed some compile complaints