-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathvampire.js
44 lines (30 loc) · 1.06 KB
/
vampire.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class Vampire {
constructor(name, yearConverted) {
this.name = name;
this.yearConverted = yearConverted;
this.offspring = [];
this.creator = null;
}
/** Simple tree methods **/
// Adds the vampire as an offspring of this vampire
addOffspring(vampire) {
}
// Returns the total number of vampires created by that vampire
get numberOfOffspring() {
}
// Returns the number of vampires away from the original vampire this vampire is
get numberOfVampiresFromOriginal() {
}
// Returns true if this vampire is more senior than the other vampire. (Who is closer to the original vampire)
isMoreSeniorThan(vampire) {
}
/** Stretch **/
// Returns the closest common ancestor of two vampires.
// The closest common anscestor should be the more senior vampire if a direct ancestor is used.
// For example:
// * when comparing Ansel and Sarah, Ansel is the closest common anscestor.
// * when comparing Ansel and Andrew, Ansel is the closest common anscestor.
closestCommonAncestor(vampire) {
}
}
module.exports = Vampire;