Commit cecbe107 authored by mercury233's avatar mercury233 Committed by Unicorn369

revert & fix MultiStringMaster

parent 13367b24
...@@ -124,7 +124,7 @@ public class Book : WindowServant2D ...@@ -124,7 +124,7 @@ public class Book : WindowServant2D
master.remove(item.get_data().Name); master.remove(item.get_data().Name);
} }
} }
deckString += master.managedString; deckString += master.managedString.TrimEnd('\n');
lab.text = deckString; lab.text = deckString;
} }
if (labop != null) if (labop != null)
...@@ -146,7 +146,7 @@ public class Book : WindowServant2D ...@@ -146,7 +146,7 @@ public class Book : WindowServant2D
master.Add(item.get_data().Name); master.Add(item.get_data().Name);
} }
} }
opString += master.managedString; opString += master.managedString.TrimEnd('\n');
if (master.strings.Count > 0) if (master.strings.Count > 0)
{ {
labop.text = InterString.Get("[ff5555]对手使用过:@n[?][-]", opString); labop.text = InterString.Get("[ff5555]对手使用过:@n[?][-]", opString);
......
...@@ -11,13 +11,7 @@ public class MultiStringMaster ...@@ -11,13 +11,7 @@ public class MultiStringMaster
public List<part> strings = new List<part>(); public List<part> strings = new List<part>();
private string _managedString = ""; public string managedString = "";
public string managedString
{
get { return _managedString.TrimEnd('\n'); }
set { _managedString = value; }
}
public void Add(string str) public void Add(string str)
{ {
...@@ -37,16 +31,16 @@ public class MultiStringMaster ...@@ -37,16 +31,16 @@ public class MultiStringMaster
t.str = str; t.str = str;
strings.Add(t); strings.Add(t);
} }
_managedString = ""; managedString = "";
for (int i = 0; i < strings.Count; i++) for (int i = 0; i < strings.Count; i++)
{ {
if (strings[i].count == 1) if (strings[i].count == 1)
{ {
_managedString += strings[i].str + "\n"; managedString += strings[i].str + "\n";
} }
else else
{ {
_managedString += strings[i].str + "*" + strings[i].count.ToString() + "\n"; managedString += strings[i].str + "*" + strings[i].count.ToString() + "\n";
} }
} }
} }
...@@ -54,7 +48,7 @@ public class MultiStringMaster ...@@ -54,7 +48,7 @@ public class MultiStringMaster
public void clear() public void clear()
{ {
strings.Clear(); strings.Clear();
_managedString = ""; managedString = "";
} }
public void remove(string str) public void remove(string str)
...@@ -78,16 +72,16 @@ public class MultiStringMaster ...@@ -78,16 +72,16 @@ public class MultiStringMaster
t.count--; t.count--;
} }
} }
_managedString = ""; managedString = "";
for (int i = 0; i < strings.Count; i++) for (int i = 0; i < strings.Count; i++)
{ {
if (strings[i].count == 1) if (strings[i].count == 1)
{ {
_managedString += strings[i].str + "\n"; managedString += strings[i].str + "\n";
} }
else else
{ {
_managedString += strings[i].str + "*" + strings[i].count.ToString() + "\n"; managedString += strings[i].str + "*" + strings[i].count.ToString() + "\n";
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment