Page 1 of 1

About Constants,java

PostPosted: 15 Aug 2011, 15:03
by Max mtg
I am about to a couple of enums to project to make quest victory conditions more convinient to track, so I guess I should include them into constants.java?

I have also noted that the constants already defined are stored as strings. Why not enums?

Code: Select all
    public enum GameEndReason
    {
        AllOpponentsLost,
        // Noone won
        Draw,       // Max mtg: I have little idea how they can reach a draw, so I didn't enumerate possible reasons here 
        // Special conditions, they force one player to win and thus end the game
        BattleOfWits,
        HelixPinnacle,
        EpicStruggle,
        BarrenGlory,
        NearDeathExperience,
        MortalCombat,
        FelidarSovereign,
        TestOfEndurance,
    }
   
    public enum PlayerLossReason // what makes this particular players lose (while others, if any, may keep playing)
    {
        DidNotLoseYet,      // a winner must have this status by the end of the game 
       
        Conceded,           // rule 104.3a
        LifeReachedZero,    // rule 104.3b
        Milled,             // 104.3c
        Poisoned,           // 104.3d

        // 104.3e and others
        DoorToNothingness,              // Door To Nothingness's ability activated
       
        // TODO: Implement game logics for the ones below
        Transcendence20Life,            // When you have 20 or more life, you lose the game.
        FailedToPayPactUpkeep,          // Pacts from Future Sight series (cost 0 but you must pay their real cost at next turn's upkeep, otherwise GL)
        PhageTheUntouchableDamage,      // Whenever Phage deals combat damage to a player, that player loses the game.
        PhageTheUntouchableWrongETB,    // When Phage the Untouchable ETB, if you didn't cast it from your hand, you lose the game.
        NefariousLichLeavesTB,          // When Nefarious Lich leaves the battlefield, you lose the game.
        NefariousLichCannotExileGrave,  // If damage would be dealt to you, exile that many cards from your graveyard instead. If you can't, you lose the game.
        LichWasPutToGraveyard,          // When Lich is put into a graveyard from the battlefield, you lose the game.
        FinalFortune,                   // same as Warrior's Oath - lose at the granted extra turn's end step
        ImmortalCoilEmptyGraveyard,     // When there are no cards in your graveyard, you lose the game.
        ForbiddenCryptEmptyGraveyard,   // If you would draw a card, return a card from your graveyard to your hand instead. If you can't, you lose the game.

        // Amulet of quoz skipped for using ante,
        // Form of the Squirrel and Rocket-Powered Turbo Slug skipped for being part of UN- set

        // refer to http://gatherer.wizards.com/Pages/Search/Default.aspx?output=standard&text=+[%22lose+the+game%22] for more cards when they are printed
    }

Re: About Constants,java

PostPosted: 17 Aug 2011, 00:19
by Braids
Max mtg wrote:I am about to a couple of enums to project to make quest victory conditions more convinient to track, so I guess I should include them into constants.java?
if it's specific to the quest, you might consider modifying or placing a new class in forge.quest.data. if it's not quest-specific, i would suggest something under forge.model.

Max mtg wrote:I have also noted that the constants already defined are stored as strings. Why not enums?
age, probably. i believe Forge has been around longer than Java has supported enums.