Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 state

Back to all declarations

Width

untyped bigint

Value

(1250 <untyped> bigint)

Height

untyped bigint

Value

(800 <untyped> bigint)

DefaultMaxBatch

untyped bigint

Value

(5000 <untyped> bigint)

HardMaxBatch

untyped bigint

Value

(20000 <untyped> bigint)

DefaultPrice

int64

Value

50000

DefaultAdmin

untyped string

Value

"g1v7s3j506wqul2zwt90awgjphpx4ztwga0926f7"

Denom

untyped string

Value

"ugnot"

price

int64

Value

50000

maxBatch

int

Value

5000

owner

.uverse.address

Value

<gnolang.StringValue>

revenue

int64

// total ugnot ever paid for pixels

Value

10600000

paints

int64

// number of successful Paint/PaintBatch calls

Value

12

version

int64

Value

12

Paint

func(x int, y int, color int)

Paint colors one pixel. Send exactly Price() ugnot (nothing for the admin).

Open
OID
0920be…0783:15
Paint details

Inspect func

PaintBatch

func(pixels string)

PaintBatch colors up to MaxBatchSize() pixels in one call. The argument is "x,y,color;x,y,color;...". Send exactly Price() \* count ugnot (nothing for the admin).

Open
OID
0920be…0783:17
PaintBatch details

Inspect func

paint

func(px []v0.Pixel, rlm .uverse.realm)

paint takes the realm as its LAST parameter on purpose: a realm first parameter would make it a crossing function and Previous() would then be this realm instead of the user.

Open
OID
0920be…0783:18
paint details

Inspect func

sentUgnot

func(coins chain.Coins) int64

sentUgnot returns the ugnot amount in coins and rejects any other denom, so a caller cannot pay with something the realm does not price.

Open
OID
0920be…0783:19
sentUgnot details

Inspect func

assertOwner

func(int, rlm .uverse.realm)

assertOwner panics unless the verified caller behind rlm is the owner. The realm is deliberately not the first parameter (see paint); the leading blank int is the same idiom gno.land/p/nt/ownable uses.

Open
OID
0920be…0783:20
assertOwner details

Inspect func

SetPrice

func(ugnot int64)

SetPrice changes the price per pixel, in ugnot. Zero makes painting free for everyone.

Open
OID
0920be…0783:21
SetPrice details

Inspect func

SetMaxBatch

func(n int)

SetMaxBatch changes the maximum pixels per PaintBatch call, 1..HardMaxBatch.

Open
OID
0920be…0783:22
SetMaxBatch details

Inspect func

Withdraw

func(to .uverse.address, amount int64)

Withdraw sends amount ugnot held by the realm to the given address. Payments are forwarded on arrival, so this only matters for coins sent to the realm outside of a paint call.

Open
OID
0920be…0783:23
Withdraw details

Inspect func

TransferOwnership

func(newOwner .uverse.address)

TransferOwnership hands the admin role (payments, free painting and the owner controls) to newOwner.

Open
OID
0920be…0783:24
TransferOwnership details

Inspect func

Pixel

func(x int, y int) int

Pixel returns the color index at (x, y); 0 means never painted.

Open
OID
0920be…0783:33
Pixel details

Inspect func

Rows

func(from int, to int) string

Rows returns rows \[from, to) as one hex digit per pixel, Width digits per row, with no separators. Clients page through the grid with it.

Open
OID
0920be…0783:34
Rows details

Inspect func

Version

func() int64

Version is the number of successful paint calls so far. Clients remember it and ask DirtyRows for what changed since.

Open
OID
0920be…0783:35
Version details

Inspect func

DirtyRows

func(since int64) string

DirtyRows lists the rows painted after version \`since\`, as "y,y,y" in ascending order. DirtyRows(0) is every row that was ever painted, which is all a fresh client needs to load: the others are blank.

Open
OID
0920be…0783:36
DirtyRows details

Inspect func

Palette

func() string

Palette returns the 16 palette colors as comma-separated CSS hex values, index 0 being the blank color.

Open
OID
0920be…0783:37
Palette details

Inspect func

Render

func(string) string

Render shows the game stats on gnoweb. The path is ignored.

Open
OID
0920be…0783:38
Render details

Inspect func

Realm

untyped string

Realm is this realm's gnoweb path.

Value

"/r/g1v7s3j506wqul2zwt90awgjphpx4ztwga0926f7/gnodraw/v0"
Width : untyped bigint =(1250 <untyped> bigint)
Height : untyped bigint =(800 <untyped> bigint)
DefaultMaxBatch : untyped bigint =(5000 <untyped> bigint)
HardMaxBatch : untyped bigint =(20000 <untyped> bigint)
DefaultPrice : int64 =50000
DefaultAdmin : untyped string ="g1v7s3j506wqul2zwt90awgjphpx4ztwga0926f7"
Denom : untyped string ="ugnot"
board : *v0.Canvas Inspect
price : int64 =50000
maxBatch : int =5000
owner : .uverse.address =<gnolang.StringValue>
revenue : int64 =10600000
paints : int64 =12
version : int64 =12
rowVersion : []int64 (len=800) Inspect
Paint : func(x int, y int, color int) Inspect
PaintBatch : func(pixels string) Inspect
paint : func(px []v0.Pixel, rlm .uverse.realm) Inspect
sentUgnot : func(coins chain.Coins) int64 Inspect
assertOwner : func(int, rlm .uverse.realm) Inspect
SetPrice : func(ugnot int64) Inspect
SetMaxBatch : func(n int) Inspect
Withdraw : func(to .uverse.address, amount int64) Inspect
TransferOwnership : func(newOwner .uverse.address) Inspect
GetWidth : func() int Inspect
GetHeight : func() int Inspect
Price : func() int64 Inspect
Owner : func() .uverse.address Inspect
Painted : func() int Inspect
Revenue : func() int64 Inspect
Paints : func() int64 Inspect
MaxBatchSize : func() int Inspect
Pixel : func(x int, y int) int Inspect
Rows : func(from int, to int) string Inspect
Version : func() int64 Inspect
DirtyRows : func(since int64) string Inspect
Palette : func() string Inspect
Render : func(string) string Inspect
Realm : untyped string ="/r/g1v7s3j506wqul2zwt90awgjphpx4ztwga0926f7/gnodraw/v0"