-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from not-blond-beard/feat/load-village-view-t…
…emporary feat: load village view temporary
- Loading branch information
Showing
8 changed files
with
76 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
extends Node | ||
|
||
var villages_json_string := """{ | ||
"villages": [ | ||
{ | ||
"id": 1, | ||
"name": "평범한 도시 1", | ||
"width": 3, | ||
"height": 11, | ||
"worldX": 5, | ||
"worldY": 1, | ||
"houses": [ | ||
{ | ||
"x": 1, | ||
"y": 1, | ||
"owner": "0x53103C2D7875D2f5f02AeC3075155e268a6e3A94" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "외로운 섬", | ||
"width": 7, | ||
"height": 13, | ||
"worldX": -2, | ||
"worldY": 7, | ||
"houses": [] | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "정글", | ||
"width": 3, | ||
"height": 5, | ||
"worldX": 1, | ||
"worldY": -3, | ||
"houses": [] | ||
} | ||
] | ||
}""" | ||
var villages: Array | ||
var selected_village_index := 0 | ||
|
||
func _ready(): | ||
var json = JSON.new() | ||
var error = json.parse(villages_json_string) | ||
if error != OK: | ||
print(error) | ||
else: | ||
villages = json.data.villages | ||
|
||
func get_selected_village(): | ||
return villages[selected_village_index] |
File renamed without changes.
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