[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    unsubscribe
From:       "Piers Chambers" <piers () varyonic ! com>
Date:       2018-02-26 20:53:19
Message-ID: 00cc01d3af43$d5ab2870$81017950$ () varyonic ! com
[Download RAW message or body]



-----Original Message-----
From: ruby-talk [mailto:ruby-talk-bounces@ruby-lang.org] On Behalf Of Leam
Hall
Sent: Monday, February 26, 2018 5:46 AM
To: Ruby users
Subject: Re: Is this a decent start on a Factory?


I appreciate the feedback! Some of the comments make me think I've not
communicated the overall design or intent well. I pulled ideas out of a
larger program to focus on the Factory pattern.

The overall goal is to have fun and gain a deeper understanding of Object
Oriented Design and Programming. While some things like Character or Dice
could be better as a Hash or Method, that won't help me learn OO stuff. I'm
trying to understand patterns; I know they exist and they can be over-used.

To be honest, the Factory may not be the way to go. I am reading "Design
Patterns in Ruby" by Russ Olsen and trying to replicate the Python code
below. Here's the idea, with links to the larger code base.


An instance of Character holds data character object.
https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/lib/character.rb


If needed, Character::generate "fills in" missing information about a
Character.
https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/lib/character.rb#
L31-L45


Characters are sometimes stored in a database.
https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/toys/get_person.r
b


A character "goes through" one or more Careers. "Goes through" modifies 
the character and can add fields like equipment.
https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/bin/chargen


(Pardon the Python; this is what I'm trying to replicate)
A group of people may need to be generated for a starship or mercenary 
group. The size of the ship or group determines what types of Career are 
best and what skills are required.
https://github.com/makhidkarun/py_tools/blob/master/crew.py



(Future State)
Characters will be stored in the database automatically.
A ship crew will be assigned to a particular ship.
A Mercenary unit will have a personnel roster.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>


Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic