-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (27 loc) · 783 Bytes
/
main.go
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
package main
import (
"fmt"
"github.com/vindecodex/Aryzath/prototype/game"
)
func main() {
// Version 1 of our game only has a theme of Action and war
theme := []string{"Action", "War"}
game_v1 := game.Game{
Version: "v1.0.0",
Title: "Game of Thrones",
Theme: theme,
Platform: "PC",
}
// Version 2 of our game added an Adventure theme
game_v2 := game_v1.Clone()
game_v2.SetVersion("v2.0.0")
game_v2.SetTheme("Adventure")
fmt.Println("Game V1: ", game_v1) // version 1 of our game
fmt.Println("Game V2: ", *game_v2) // version 2 of our game
// We can create another version using game_v2 or game_v1
game_v3 := game_v2.Clone()
game_v4 := game_v2.Clone()
// No changes made
fmt.Println("Game V3: ", game_v3)
fmt.Println("Game v4: ", game_v4)
}