Rogue C# – Taking Inventory
It’s time to add more inventory items but first we need a way to define their abilities without getting lost in the code.
Technology should be the means, not the end.
So much of what we see and hear is not the truth of any given situation; sometimes it’s necessary to close the eyes and be still, to extend our awareness beyond what we’ve been conditioned to believe is our field of sensory operation. Only then can we learn the patience to trust that all the information that we need will come to us.
Andrew J. Robinson, A Stitch in Time (Star Trek, DS9 #27)
It’s time to add more inventory items but first we need a way to define their abilities without getting lost in the code.
The method for processing user commands was getting out of control so I decided on some creative use of the Dictionary class to automate things.
In this chapter, I review the access modifiers available in C# and how they affect where properties and procedures can be accessed in the code.
In the latest chapter, a flowchart of the Game startup process points me to a problem assigning inventory to the player.
The classes in the Rogue C# code were developed over time and I decided an important part of the project rescue was to look them over and see who was talking to whom.
While quality code should be well-commented and easy to follow, sometimes you need other types of documentation to actually see the shape of a process. In this chapter, I flowchart the map creation process and find ways to improve the code.
In this chapter, we’re going back to the official list of requirements for our Roguelike and expanding them to cover the game from start to finish.
In this update, I’m ditching the monochrome map and adding some color graphics on the map with text drawing via the TextRenderer class.
It’s been a few years since the last report from the Rogue C# project and the dungeon retains its mysteries. Time to dust off the project notes and find what awaits discovery.
Coming back around to the inventory side of the game, I decided to add some extra variety to the available items, starting with the scrolls and potions.