コード例 #1
0
ファイル: Update.cs プロジェクト: ARLM-Attic/xna-xen
        private void MoveItem(UpdateEntry update, UpdateFrequency frequency)
        {
            int index = (int)frequency;

            Updater[] list = updaters[index];

            list[frameUpdateIndex[index]].AddMovedItem(update);
        }
コード例 #2
0
ファイル: Update.cs プロジェクト: ARLM-Attic/xna-xen
 public void AddMovedItem(UpdateEntry entry)
 {
     if (entriesHighIndex == entries.Length)
     {
         Array.Resize(ref entries, entries.Length * 2);
     }
     entry.index   = entriesHighIndex;
     entry.updater = this;
     entries[entriesHighIndex++] = entry;
 }
コード例 #3
0
ファイル: Update.cs プロジェクト: ARLM-Attic/xna-xen
        //must be locked to sync
        private void AddItem(IUpdate update)
        {
            if (entriesHighIndex == entries.Length)
            {
                Array.Resize(ref entries, entries.Length * 2);
            }
            UpdateEntry entry = new UpdateEntry(update, this, entriesHighIndex);

            indices.Add(update, entry);
            entries[entriesHighIndex++] = entry;
        }
コード例 #4
0
ファイル: Update.cs プロジェクト: ARLM-Attic/xna-xen
        public void RemoveAt(UpdateEntry entry)
        {
            bool enter = Monitor.TryEnter(syncMajor);

            if (enter && !iteratingList)
            {
                RemoveIndex(entry);
            }
            else
            {
                actionList.Add(new Action(entry, false));
            }
            if (enter)
            {
                Monitor.Exit(syncMajor);
            }
        }
コード例 #5
0
ファイル: Update.cs プロジェクト: ARLM-Attic/xna-xen
 //must be in syncminor
 private void RemoveIndex(UpdateEntry entry)
 {
     indices.Remove(entry.item);
     entries[entry.index] = null;
 }