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

Commit

Permalink
Allow one-sided province mappings
Browse files Browse the repository at this point in the history
Mark one-sided and many-to-many province mappings in the output comments
  • Loading branch information
dtremenak committed Feb 24, 2012
1 parent 81fab91 commit 1822689
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ProvinceMapper/Changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 7 additions & 1 deletion ProvinceMapper/Mapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { ";
Expand All @@ -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;
}

Expand Down

0 comments on commit 1822689

Please sign in to comment.