Commit 33db0174 authored by mercury233's avatar mercury233

revert & fix MultiStringMaster

parent 6f6244fc
......@@ -124,7 +124,7 @@ public class Book : WindowServant2D
master.remove(item.get_data().Name);
}
}
deckString += master.managedString;
deckString += master.managedString.TrimEnd('\n');
lab.text = deckString;
}
if (labop != null)
......@@ -146,7 +146,7 @@ public class Book : WindowServant2D
master.Add(item.get_data().Name);
}
}
opString += master.managedString;
opString += master.managedString.TrimEnd('\n');
if (master.strings.Count > 0)
{
labop.text = InterString.Get("[ff5555]对手使用过:@n[?][-]", opString);
......
......@@ -11,13 +11,7 @@ public class MultiStringMaster
public List<part> strings = new List<part>();
private string _managedString = "";
public string managedString
{
get { return _managedString.TrimEnd('\n'); }
set { _managedString = value; }
}
public string managedString = "";
public void Add(string str)
{
......@@ -37,16 +31,16 @@ public class MultiStringMaster
t.str = str;
strings.Add(t);
}
_managedString = "";
managedString = "";
for (int i = 0; i < strings.Count; i++)
{
if (strings[i].count == 1)
{
_managedString += strings[i].str + "\n";
managedString += strings[i].str + "\n";
}
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
public void clear()
{
strings.Clear();
_managedString = "";
managedString = "";
}
public void remove(string str)
......@@ -78,16 +72,16 @@ public class MultiStringMaster
t.count--;
}
}
_managedString = "";
managedString = "";
for (int i = 0; i < strings.Count; i++)
{
if (strings[i].count == 1)
{
_managedString += strings[i].str + "\n";
managedString += strings[i].str + "\n";
}
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