Exemplo n.º 1
0
        /// <summary> Finds all block changes by the given player. </summary>
        public void FindChangesBy(int id, Action <BlockDBEntry> output, out Vec3U16 dims)
        {
            dims = default(Vec3U16);
            using (IDisposable readLock = locker.AccquireReadLock()) {
                if (!File.Exists(FilePath))
                {
                    return;
                }

                using (Stream s = File.OpenRead(FilePath)) {
                    BlockDBFile.ReadHeader(s, out dims);
                    BlockDBFile.IterateBackwards(s, e => {
                        if (e.PlayerID == id)
                        {
                            output(e);
                        }
                    });
                }
            }
        }