-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77110c6
commit 27e9e83
Showing
4 changed files
with
16 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
extends Grid | ||
|
||
func set_cell_ownership(x, y, value): | ||
set_cell(x*3, y*3, value) | ||
|
||
func set_cellv_ownership(pos, value): | ||
set_cell(pos.x*3, pos.y*3, value) | ||
var x = pos.x * 3 | ||
var y = pos.y * 3 | ||
var start_seek_pos = (y * width + x) * bytes_per_entry | ||
if start_seek_pos >= 0 and start_seek_pos < buffer_size: | ||
var seek_pos = start_seek_pos | ||
for _i in range(3): | ||
for _j in range(3): | ||
buffer.seek(seek_pos) | ||
buffer.put_u8(value) | ||
seek_pos += bytes_per_entry | ||
seek_pos += (width - 3) * bytes_per_entry | ||
|
||
|
||
func get_cell_ownership(x, y): | ||
return get_cell(x*3, y*3) | ||
|
||
|
||
|
||
func get_cellv_ownership(pos): | ||
return get_cell(pos.x*3, pos.y*3) |
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