Comments (3)
I agree that this could be better, but it's not clear if the data should be preprocessed by a function or if a new class should be made to encapsulate the data.
Did you have any code examples on your own project or is this just speculation so far?
from tcod_tutorial_v2.
I haven't actually written any code based on the tutorial; this is just based on my thoughts from reading it. In the simplest case the data is entered into the source code already in the correct format. To reduce the risk of human error, I think it would make sense to create a class to hold the configuration data and sort it in the constructor (or after loading it from a file or whatever way it is that the data gets into the class).
I could do a quick fork and create a pull request if you think that would be useful.
from tcod_tutorial_v2.
I'm not sure. If you want to do a pull request then make sure you start from the part-12
branch.
Ideally a new solution should be more readable then the current one. The performance for this section is not critical so I don't think the redundant calls to get_max_value_for_floor
are a problem unless they affect readability.
from tcod_tutorial_v2.
Related Issues (17)
- Notes on Part 4: Field of View. HOT 3
- Part 5: Context sensitive actions. HOT 4
- Part 5: Entity contianer issues. HOT 2
- Part 5: Entity prorotypes and type extensibility. HOT 2
- Part 5: Enemy turn. HOT 2
- Part 9, consumable.py, LightningDamageConsumable HOT 1
- Question regarding best practices HOT 2
- Question: Difference between going to engine vs entity for game_map? HOT 2
- Part 6: Clarification on Player AI HOT 1
- render_functions.py : get_names_at_location Capitalization HOT 1
- AskUserEventHandler for Inventory
- Dropping multiple identical items on a tile only creates one instance of the item. HOT 6
- Planned refactors for 2021. HOT 1
- Notes on tcod event handling. HOT 3
- Part 6: AttributeError: 'Actor' object has no attribute 'render_order' HOT 2
- Entities is initialized as a list, but code treats it as a set. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcod_tutorial_v2.