-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from hmlendea/titles
Title localisations generator for CK2
- Loading branch information
Showing
21 changed files
with
325 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
using NuciDAL.DataObjects; | ||
|
||
namespace MoreCulturalNamesModBuilder.DataAccess.DataObjects | ||
{ | ||
public class TitleEntity : EntityBase | ||
{ | ||
[XmlArrayItem("TitleId")] | ||
public List<string> FallbackTitles { get; set; } | ||
|
||
public List<GameIdEntity> GameIds { get; set; } | ||
|
||
public List<NameEntity> Names { get; set; } | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,43 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using MoreCulturalNamesModBuilder.DataAccess.DataObjects; | ||
using MoreCulturalNamesModBuilder.Service.Models; | ||
|
||
namespace MoreCulturalNamesModBuilder.Service.Mapping | ||
{ | ||
static class NameMapping | ||
{ | ||
internal static Name ToServiceModel(this NameEntity dataObject) | ||
{ | ||
Name serviceModel = new Name(); | ||
serviceModel.LanguageId = dataObject.LanguageId; | ||
serviceModel.Value = dataObject.Value; | ||
|
||
return serviceModel; | ||
} | ||
|
||
internal static NameEntity ToDataObject(this Name serviceModel) | ||
{ | ||
NameEntity dataObject = new NameEntity(); | ||
dataObject.LanguageId = serviceModel.LanguageId; | ||
dataObject.Value = serviceModel.Value; | ||
|
||
return dataObject; | ||
} | ||
|
||
internal static IEnumerable<Name> ToServiceModels(this IEnumerable<NameEntity> dataObjects) | ||
{ | ||
IEnumerable<Name> serviceModels = dataObjects.Select(dataObject => dataObject.ToServiceModel()); | ||
|
||
return serviceModels; | ||
} | ||
|
||
internal static IEnumerable<NameEntity> ToDataObjects(this IEnumerable<Name> serviceModels) | ||
{ | ||
IEnumerable<NameEntity> dataObjects = serviceModels.Select(serviceModel => serviceModel.ToDataObject()); | ||
|
||
return dataObjects; | ||
} | ||
} | ||
} |
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,47 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using MoreCulturalNamesModBuilder.DataAccess.DataObjects; | ||
using MoreCulturalNamesModBuilder.Service.Models; | ||
|
||
namespace MoreCulturalNamesModBuilder.Service.Mapping | ||
{ | ||
static class TitleMapping | ||
{ | ||
internal static Title ToServiceModel(this TitleEntity dataObject) | ||
{ | ||
Title serviceModel = new Title(); | ||
serviceModel.Id = dataObject.Id; | ||
serviceModel.GameIds = dataObject.GameIds.ToServiceModels(); | ||
serviceModel.FallbackTitles = dataObject.FallbackTitles; | ||
serviceModel.Names = dataObject.Names.ToServiceModels(); | ||
|
||
return serviceModel; | ||
} | ||
|
||
internal static TitleEntity ToDataObject(this Title serviceModel) | ||
{ | ||
TitleEntity dataObject = new TitleEntity(); | ||
dataObject.Id = serviceModel.Id; | ||
dataObject.GameIds = serviceModel.GameIds.ToDataObjects().ToList(); | ||
dataObject.FallbackTitles = serviceModel.FallbackTitles.ToList(); | ||
dataObject.Names = serviceModel.Names.ToDataObjects().ToList(); | ||
|
||
return dataObject; | ||
} | ||
|
||
internal static IEnumerable<Title> ToServiceModels(this IEnumerable<TitleEntity> dataObjects) | ||
{ | ||
IEnumerable<Title> serviceModels = dataObjects.Select(dataObject => dataObject.ToServiceModel()); | ||
|
||
return serviceModels; | ||
} | ||
|
||
internal static IEnumerable<TitleEntity> ToDataObjects(this IEnumerable<Title> serviceModels) | ||
{ | ||
IEnumerable<TitleEntity> dataObjects = serviceModels.Select(serviceModel => serviceModel.ToDataObject()); | ||
|
||
return dataObjects; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.