Skip to content
This repository has been archived by the owner on Dec 29, 2017. It is now read-only.

Separate main project components into classes #18

Open
JoshuaKGoldberg opened this issue Apr 8, 2016 · 1 comment
Open

Separate main project components into classes #18

JoshuaKGoldberg opened this issue Apr 8, 2016 · 1 comment
Assignees

Comments

@JoshuaKGoldberg
Copy link
Member

Instead of FSM.animate*, for example, those should be in a FullScreenMarioAnimations (class? container? namespace?) defined in a separate file.

Requires Typescript 2.0 for specifying this for functions.

@JoshuaKGoldberg
Copy link
Member Author

Proposal: have classes as containers, with static instances of them in the FullScreenPokemon class.

FullScreenPokemon.ts:

class FullScreenPokemon {
    // ...
    public static readonly Macros: MacrosBag = new FullScreenPokemonMacros();
    // ...
}

settings/maps.ts:

namespace FullScreenPokemon {
    FullScreenPokemon.prototype.settings.maps = {
        // ...
        macros: {
            House: FullScreenPokemon.Macros.House
        }
        // ...
    };
}

MacrosBag.ts:

namespace FullScreenPokemon {
    export class MacrosBag {
        public House(/* ... */) { /* ... */ }
    }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant