-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
96 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using AA2Snowflake.Personalities; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using SB3Utility; | ||
using AA2Data; | ||
using System.IO; | ||
|
||
namespace AA2Snowflake | ||
{ | ||
public enum LSTMode | ||
{ | ||
Default, | ||
Custom | ||
} | ||
|
||
public static class LSTFactory | ||
{ | ||
public static PersonalityLST LoadLST(this IPersonality p) | ||
{ | ||
if (p.Custom) | ||
{ | ||
return new CustomPersonalityLST(p.GetLst().ToStream().ToArray()); | ||
} | ||
else | ||
{ | ||
return new PersonalityLST(p.GetLst().ToStream().ToArray()); | ||
} | ||
} | ||
|
||
public static PersonalityLST LoadLST(this IWriteFile iw, LSTMode mode) | ||
{ | ||
if (mode == LSTMode.Custom) | ||
{ | ||
return new CustomPersonalityLST(iw.ToStream().ToArray()); | ||
} | ||
else | ||
{ | ||
return new PersonalityLST(iw.ToStream().ToArray()); | ||
} | ||
|
||
} | ||
|
||
public static IWriteFile ToSubfile(this BaseLST lst, string name) | ||
{ | ||
return new MemSubfile(new MemoryStream(lst.raw), name); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters