示例#1
0
        public StatsEntry Get(string key)
        {
            StatsEntry entry = Dict[key];

            if (entry == null)
            {
                throw new Exception("Unknown stats.");
            }
            return(entry);
        }
示例#2
0
        public void UpdateValue(string key, string newValue)
        {
            StatsEntry entry = Get(key);

            if (entry.Value != newValue)
            {
                entry.Value = newValue;
                Engine.Instance.OnStatsChange(entry);
            }
        }
示例#3
0
        public void Add(string key, string caption, string icon, string clickable)
        {
            StatsEntry entry = new StatsEntry();

            entry.Key       = key;
            entry.Caption   = caption;
            entry.Icon      = icon;
            entry.Clickable = clickable;
            Dict[key]       = entry;
            List.Add(entry);
        }
示例#4
0
        public void Add(string key, string caption, string icon, bool dump)
        {
            StatsEntry entry = new StatsEntry();

            entry.Key     = key;
            entry.Caption = caption;
            entry.Icon    = icon;
            entry.Dump    = dump;
            Dict[key]     = entry;
            List.Add(entry);
        }
示例#5
0
        public void UpdateValue(string key, string newValue)
        {
            StatsEntry entry = Get(key);

            if (entry.Value != newValue)
            {
                entry.Value = newValue;

                XmlItem xml = new XmlItem("command");
                xml.SetAttribute("action", "ui.stats.change");
                entry.WriteXML(xml);
                Engine.Instance.Command(xml);

                Engine.Instance.OnStatsChange(entry);
            }
        }
示例#6
0
 public virtual void OnStatsChange(StatsEntry entry)
 {
 }
示例#7
0
 public override void OnStatsChange(StatsEntry entry)
 {
     if (FormMain != null)
         FormMain.StatsChange(entry);
 }
示例#8
0
 public void StatsChange(StatsEntry entry)
 {
     if(this.InvokeRequired)
     {
         StatsChangeDelegate inv = new StatsChangeDelegate(this.StatsChange);
         this.BeginInvoke(inv, new object[] { entry });
     }
     else
     {
         if (m_statsItems.ContainsKey(entry.Key))
         {
             ListViewItemStats item = m_statsItems[entry.Key];
             if (item.SubItems.Count == 1)
                 item.SubItems.Add("");
             item.SubItems[1].Text = entry.Text;
         }
     }
 }
示例#9
0
        public override void OnStatsChange(StatsEntry entry)
        {
            base.OnStatsChange (entry);

            if (MainWindow != null)
            if (MainWindow.TableStatsController != null) {
                new NSObject ().InvokeOnMainThread (() => {
                    MainWindow.TableStatsController.RefreshUI ();
                });
            }
        }
示例#10
0
 public void Add(string key, string caption, string icon, string clickable)
 {
     StatsEntry entry = new StatsEntry();
     entry.Key = key;
     entry.Caption = caption;
     entry.Icon = icon;
     entry.Clickable = clickable;
     Dict[key] = entry;
     List.Add(entry);
 }