-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nigel (MacBook) <nigel@laptop>
- Loading branch information
Showing
87 changed files
with
392 additions
and
235 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import { | |
red, | ||
white, | ||
yellow, | ||
} from "https://deno.land/std@0.219.1/fmt/colors.ts"; | ||
} from "https://deno.land/std@0.220.1/fmt/colors.ts"; | ||
import { getTag } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Creature } from "../Creature.ts"; | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { blue, bold, cyan } from "https://deno.land/std@0.219.1/fmt/colors.ts"; | ||
import { blue, bold, cyan } from "https://deno.land/std@0.220.1/fmt/colors.ts"; | ||
import { addTag, getTag } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Creature } from "../Creature.ts"; | ||
import { CreatureUtil } from "./CreatureUtils.ts"; | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { TagInterface } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { SynapseExport, SynapseInternal } from "./SynapseInterfaces.ts"; | ||
|
||
export class Synapse implements SynapseInternal { | ||
|
@@ -6,6 +7,8 @@ export class Synapse implements SynapseInternal { | |
public type?: "positive" | "negative" | "condition"; | ||
public weight: number; | ||
|
||
public tags?: TagInterface[]; | ||
|
||
public static randomWeight() { | ||
return Math.random() * 0.2 - 0.1; | ||
} | ||
|
@@ -33,6 +36,7 @@ export class Synapse implements SynapseInternal { | |
fromUUID: fromUUID, | ||
toUUID: toUUID, | ||
type: this.type, | ||
tags: this.tags ? this.tags.slice() : undefined, | ||
}; | ||
|
||
return json; | ||
|
@@ -44,6 +48,7 @@ export class Synapse implements SynapseInternal { | |
from: this.from, | ||
to: this.to, | ||
type: this.type, | ||
tags: this.tags ? this.tags.slice() : undefined, | ||
}; | ||
|
||
return json; | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { TagInterface } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { SynapseState } from "./CreatureState.ts"; | ||
|
||
interface SynapseCommon { | ||
weight: number; | ||
type?: "positive" | "negative" | "condition"; | ||
|
||
tags?: TagInterface[]; | ||
} | ||
|
||
export interface SynapseInternal extends SynapseCommon { | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.