It is currently 07 Sep 2025, 12:29
   
Text Size

We handle constructed decks in subfolders now

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

We handle constructed decks in subfolders now

Postby Max mtg » 19 Aug 2013, 22:50

Max mtg wrote:My to do after 1.4.4:
* Make IStorage<T> implementation that reads files traverse subfolders and be iterable as both flat list and groupped by folders. Per popular request.
(The UI part of effort to support decks arranged into folders is up to the rest of the team.)
The feature is half-complete now:
Forge can read subfolders in constructed deck, you may start game with such deck, but cannot yet edit decks in subfolders nor manipulate subfolders.

Marek14 wrote:Also, is it strictly necessary to read and convert deckfiles on start? Can't they just be read and converted (if that's necessary) on the fly?
Why should not they be converted?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: We handle constructed decks in subfolders now

Postby Xitax » 20 Aug 2013, 01:15

I strongly prefer them to be converted on startup, because file renaming often occurs and I'd rather that happen right away than at some future unknown time.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: We handle constructed decks in subfolders now

Postby Marek14 » 20 Aug 2013, 05:25

Well, why should the files even be renamed?

Basically, this way adding a new deck is a lengthy process that involves shutting Forge down and restarting it (and it takes some time to restart). If it's really necessary, how about adding a "Reload decks" button that would perform this operation without shutting the program down? Or even, with subfolders, "Reload folder" which would reduce time needed for checking.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: We handle constructed decks in subfolders now

Postby Max mtg » 20 Aug 2013, 07:25

Files are renamed to keep their names in accordance with the Name property written inside the deck file.

It is possible to teach Forge how to watch changes to folders with constructed decks. As these events are handled, the in-memory deck collection can be updated accordingly.
That will take some time and is to become an extra part of this iteration devoted to subfolders.

Would anyone else need this feature?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: We handle constructed decks in subfolders now

Postby Marek14 » 20 Aug 2013, 09:58

Max mtg wrote:Files are renamed to keep their names in accordance with the Name property written inside the deck file.
Once again: is that even important? From what I've seen, the benefit of Name property is mainly that this way, the deck name can contain characters that are not acceptable in filenames -- such decks won't be renamed perfectly in any case. The deck list uses the "Name" property instead of the file name. The file name is not visible from anywhere in Forge.

Sure, it's generally a good idea to keep the two same, or at least similar, but I don't think it should be rigidly enforced. If someone wants to keep the names different (perhaps storing extra information in filenames, like type of deck or date), is it really so important to not allow that?
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: We handle constructed decks in subfolders now

Postby Max mtg » 20 Aug 2013, 12:15

Why would you need old file names? Are you intending to use the deck collection elsewhere?

So, are you requesting extra attributes added to deck files? Attributes like 'author', 'date', and 'top tournament' with 'best place' sound reasonable to me.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: We handle constructed decks in subfolders now

Postby Marek14 » 20 Aug 2013, 13:26

Well, extra attributes might be fun :) As for the names, there's one reason not to change them: you can rename the files in a batch (for example, giving new decks names NEW_*.* until you actually try them out), but it's much harder to make some global changes to name field inside the file. Of course, this won't be as relevant if we'll have folders.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 54 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 54 users online :: 0 registered, 0 hidden and 54 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 54 guests

Login Form