Coder Social home page Coder Social logo

aihr-universe's Introduction

Aihr Universe

The project shows, how to organise SolarSystem structure.

Note!
Some of the task's requirements I decided to implement in my own way, I put them into Assumptions section.

Get Started

  1. Open the solution and press Run (tested with Rider).
  2. You will see all the necessary structure in a console.

Warning!
Not the whole information is printed in a console.

Assumptions

Topic Comment
Celestial Bodies Not all the types are presented: Stars, Planets, Satellites, DwarfPlanets only. There are no Comets, Asteroids, and Meteors.
Satellites In a context of this project - it's a natural object of Solar System, which are not made by human (e.g. only Moons are here).
Satellites Limit Maximum amount of satellites for any object is 2 (sorry, but too much googling for parameters).
Terraformed Bodies In a context of this project I didn't put ITerraformed interface to any satellite, only for planets, no sense to do it, no logic in the requirements.
Orbital Period Represents days without too specific hours (e.g. 0.25 days, not like 0.234141251 days), if you are interested how I work with big numbers, look at the Mass class.
Linked Objects Now I have one-directional linked list (Planet -> Satellite), but better to have Planet <-> Satellite that will allow any Satellite to find its planet.
Nullable Properties There are nullable or open to be set properties, as we have missing information for some of the celestial bodies, or even we not fully opened amount of planets in the system (e.g. Planet X)
Distances Better to have not a distance between Sun and Object, or Parent and Object, but a coordinates to calculate vector if needed
Colonize Better do not have any logic in extension methods, instead we need to CanColonize method and move all the business logic to a separate Colonizer service (but it too many time already here), see SRP - Single Responsibility Principle

Perfect === Good Enough

Note!
Implement an interface for all celestial bodies that "Can sustain life", "Can be terraformed", and "Has satellite moon(s)" and an extension method named Colonize().

There is no sense to implement these interfaces for all the Celestial Bodies, much better to add it to specific objects, like Mars or Venus. Also, HasSatelliteMoons interface will violate OCP - Open-Closed Principle, so I decided to do extension method, that will work without manual changes in case of adding new celestial bodies ๐Ÿ‘.

ILifeSustainable - Can sustainn life interface
ITerraformed - Can be terraformed (yeah yeah, thats, difficult to follow correct names)
HasSatellitesMoons - Extension method for Planet type.

aihr-universe's People

Watchers

Aleksey Fishchev avatar

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.