Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Should I Keep These In Individual Classes?

  1. #1
    Junior Member
    Join Date
    May 2014
    Location
    Inverness, United Kingdom
    Posts
    11
    My Mood
    Cheerful
    Thanks
    0
    Thanked 1 Time in 1 Post

    Question Should I Keep These In Individual Classes?

    So I am writing a YuGiOh game (personal reasons; may release to the public though) in Java (obviously, why I am here) and I came to a conundrum: should I put the following code into different classes; making each individual card have it's own class, or keep it like this?:

    Code:

     
    package com.github.bewd.yugioh.main;
     
    public class CardListKaiba {
        private String MonsterCard;
     
        MonsterCard BlueEyesWhiteDragon = new MonsterCard(
        "This legendary dragon is a powerful engine of destruction. Virtually invincible, very few have faced this awesome creature and lived to tell the tale.",
        "Blue-Eyes White Dragon", "Light", 8, 300, 2500);
        MonsterCard HitotsuMeGiant = new MonsterCard(
        "",
        "", "", 0, 0, 0);
        MonsterCard RyuKishin  = new MonsterCard();
        MonsterCard TheWickedWormBeast = new MonsterCard();
        MonsterCard BattleOx = new MonsterCard();
        MonsterCard KoumoriDragon = new MonsterCard();
        MonsterCard JudgeMan = new MonsterCard();
        MonsterCard RogueDoll = new MonsterCard();
        MonsterCard Kojikocy = new MonsterCard();
        MonsterCard Uraby = new MonsterCard();
        MonsterCard GyakutennoMegami = new MonsterCard();
        MonsterCard MysticHorseman = new MonsterCard();
        MonsterCard TerraTheTerrible  = new MonsterCard();
        MonsterCard DarkTitanOfTerror = new MonsterCard();
        MonsterCard DarkAssailant = new MonsterCard();
        MonsterCard MasterAndExpert = new MonsterCard();
        MonsterCard UnknownWarriorOfFiend = new MonsterCard();
        MonsterCard MysticClown = new MonsterCard();
        MonsterCard OgreOfTheBlackShadow = new MonsterCard();
        SpellCard DarkEnergy = new SpellCard();
        SpellCard Invigoration = new SpellCard();
        SpellCard DarkHole = new SpellCard();
        SpellCard Oozaki = new SpellCard();
        MonsterCard RyuKishinPowered = new MonsterCard();
        MonsterCard SwordStalker = new MonsterCard();
        MonsterCard LaJinn = new MonsterCard();
        MonsterCard RudeKaiser = new MonsterCard();
        MonsterCard DestroyerGolem = new MonsterCard();
        MonsterCard SkullRedBird = new MonsterCard();
        MonsterCard DHuman = new MonsterCard();
     
        //get methods
        public String getMonsterCard(){
            return MonsterCard;
        }
     
    }

    Also: if anyone would like to join the project; I welcome it.
    Attached Images Attached Images
    Last edited by BlueEyesWhiteDragon; May 31st, 2014 at 03:35 PM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,285
    My Mood
    Mellow
    Thanks
    252
    Thanked 777 Times in 762 Posts

    Default Re: Should I Keep These In Individual Classes?

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    Please post your code correctly per the above link. You can edit your post and change the tags.

  3. #3
    Junior Member
    Join Date
    May 2014
    Location
    Inverness, United Kingdom
    Posts
    11
    My Mood
    Cheerful
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Should I Keep These In Individual Classes?

    Ahah, sorry about that, thanks. n_n

  4. #4
    Junior Member fireredlink5000's Avatar
    Join Date
    May 2014
    Posts
    4
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Should I Keep These In Individual Classes?

    Hey BlueEyesWhiteDragon,
    I recommend to stick what you currently have. I do want to give you some advice. Also add an attribute of Normal, Effect, Ritual, Fusion, etc.. That way, if there is ever a time that a user want to sort the monster base on Primary they can. Add this card too:

        MonsterCard StardustDragon = new MonsterCard(
        "1 Tuner + 1 or more non-Tuner monsters
    During either player's turn, when a card or effect is activated that would destroy a card(s) on the field: You can Tribute this card; negate the activation, and if you do, destroy it. During the End Phase, if this effect was activated this turn (and was not negated): You can Special Summon this card from your Graveyard.",
        "Stardust Dragon", "Wind", "Dragon", "Effect", "Synchro", 8, 2000, 2000);

  5. #5
    Junior Member
    Join Date
    May 2014
    Location
    Inverness, United Kingdom
    Posts
    11
    My Mood
    Cheerful
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Should I Keep These In Individual Classes?

    Thanks for the advice; I was keeping it old school leaving the GX and onwards cards out of it just now! But thanks.

Similar Threads

  1. Can't figure out how to roll individual dice.
    By mortiz492 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 19th, 2012, 03:07 PM
  2. Break down BigDecimal to individual values
    By tarkal in forum Java Theory & Questions
    Replies: 17
    Last Post: November 16th, 2011, 09:43 AM
  3. Getting length of individual token?
    By Kimimaru in forum What's Wrong With My Code?
    Replies: 10
    Last Post: February 10th, 2011, 02:48 AM
  4. Controlling individual threads
    By youngstorm in forum Threads
    Replies: 4
    Last Post: October 19th, 2010, 04:28 PM
  5. Replies: 2
    Last Post: February 4th, 2009, 12:24 PM

Tags for this Thread