This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.annotation.tailrec | |
import com.thoughtworks.enableIf | |
// Doubly-linked lists allow O(1) removals at the cost of having a | |
// reference to the doubly-linked node itself. Some game objects store | |
// their own next/prev links, which allows for a convenient reference to | |
// the doubly-linked node (i.e. it's just the value stored) however then | |
// each value can partake in at most one list at a time (per next/prev, | |
// can have multiple types of next/prev as is done with Affect). |
OlderNewer