From 18226894bff651c75d4e37bce5646eee5003b431 Mon Sep 17 00:00:00 2001 From: dtremenak Date: Fri, 24 Feb 2012 02:43:18 +0000 Subject: [PATCH] Allow one-sided province mappings Mark one-sided and many-to-many province mappings in the output comments --- ProvinceMapper/Changelog.txt | 4 ++++ ProvinceMapper/Mapping.cs | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ProvinceMapper/Changelog.txt b/ProvinceMapper/Changelog.txt index 3c1029f0a..281771ebc 100644 --- a/ProvinceMapper/Changelog.txt +++ b/ProvinceMapper/Changelog.txt @@ -1,5 +1,9 @@ ProvinceMapper Change Log +0.9E +- Allow one-sided province mappings +- Mark one-sided and many-to-many province mappings in the output comments + 0.9D - Make map inversion optional (CK2 doesn't need it) - Throw a more useful error when a province is mapped but doesn't exist in game data diff --git a/ProvinceMapper/Mapping.cs b/ProvinceMapper/Mapping.cs index b5094d824..01c63071c 100644 --- a/ProvinceMapper/Mapping.cs +++ b/ProvinceMapper/Mapping.cs @@ -116,7 +116,7 @@ public override string ToString() public virtual string ToOutputString(string srcTag, string destTag) { - if (isIncomplete()) + if (srcProvs.Count == 0 && destProvs.Count == 0) return ""; string retval = String.Empty; retval += "link = { "; @@ -129,7 +129,13 @@ public virtual string ToOutputString(string srcTag, string destTag) retval += destTag + " = " + p.ID.ToString() + " "; } retval += "}\t# "; + if (isManyToMany()) + retval += "MANY-TO-MANY: "; + if (srcProvs.Count == 0) + retval += "NOTHING"; retval += this.ToString(); + if (destProvs.Count == 0) + retval += "DROPPED"; return retval; }