restructer and move to esdoc

This commit is contained in:
Kevin Jahns
2018-03-06 03:17:36 +01:00
parent a9b610479d
commit bbc207aaa6
48 changed files with 223 additions and 227 deletions

21
src/Util/ID/RootID.js Normal file
View File

@@ -0,0 +1,21 @@
import { getReference } from './structReferences.js'
export const RootFakeUserID = 0xFFFFFF
export default class RootID {
constructor (name, typeConstructor) {
this.user = RootFakeUserID
this.name = name
this.type = getReference(typeConstructor)
}
equals (id) {
return id !== null && id.user === this.user && id.name === this.name && id.type === this.type
}
lessThan (id) {
if (id.constructor === RootID) {
return this.user < id.user || (this.user === id.user && (this.name < id.name || (this.name === id.name && this.type < id.type)))
} else {
return true
}
}
}