Giter Site home page Giter Site logo

comp-345's People

Contributors

adrianomontecalvo avatar chrisviral avatar tucci avatar

Watchers

 avatar  avatar  avatar

comp-345's Issues

Map data structure

We might have to double check with the prof to see if we are allowed to use a hash map instead of a graph. I feel like it might be a requirement in the project to add some complexity to it.

Potential deleting map issue

https://github.com/StupidChris/COMP-345/blob/5ffce13973201f6f35a40593e542f8764ec3219d/Comp345_Risk/Game/Game.cpp#L19

You have to be careful here. You have to figure out which object should own that pointer. Since you are passing the pointer from a parent object, either that parent object should delete the map or the Game object, but not both. Lets say the main driver creates the map, but then pass the pointer to the game object, should the main driver delete the map, or the game object?

Usually the initial creator of the object should own and delete it. The way you did it works, but it is something to think about. A good rule of thumb is that when other objects use another pointer owned by an object, you should pass const pointers, so that the non owner of that pointer cant modify the the pointer address, though they can still modify the object that the pointer is passing to.

Tldr; Figure out which object should delete the map. And only delete once.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.