Example #1
0
        private void ParseChestData(Status stats)
        {
            foreach (var stat in stats.Data)
            {
                if (stat.Id - StatsType.Inventory0 < 8 && stat.Id - StatsType.Inventory0 > -1)
                {
                    if (!this.m_chests.ContainsKey(stats.ObjectId))
                        this.m_chests.Add(stats.ObjectId, new int[8]);

                    this.m_chests[stats.ObjectId][stat.Id - StatsType.Inventory0] = stat.IntValue;
                }
            }
        }
Example #2
0
        private void UpdateStats(ref Status stats)
        {
            ParseChestData(stats);

            int count = 0;
            for (int i = 0; i < 8; i++)
            {
                if (this.m_chests.ContainsKey(stats.ObjectId) && this.m_chests[stats.ObjectId][i] != -1)
                    count++;
            }
            string name = string.Format("Items: {0}/8", count);
            stats.Data = stats.Data.Concat(new StatData[]
            {
                new StatData
                {
                     Id = StatsType.Name,
                     StringValue = name
                }
            }).ToArray();
        }