setTrait
Call Signature
Section titled “Call Signature”setTrait<
S>(writer,target,trait,value):void
Sets target’s trait to value: an entity’s, or the world’s for a
world trait. A trait of fields takes the fields to change; a factory
trait’s value is copied into the record it keeps, so a writer that
keeps and changes its own object changes nothing. The first argument
is what may write it: a trait the room streams takes an authority, the
room’s step or requireAuthority(world); a Reach.Local or Reach.Authority
trait takes any step; a predicted trait takes a predicted step, on the
PredictedEntity it hands out. The target holds the trait already:
addTrait adds one. It tells the trait’s watchers, as koota’s set
does. As Unity’s EntityManager.SetComponentData.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
S extends Schema |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
writer |
EntityAuthority | PredictedStep |
target |
PredictedEntity |
trait |
PredictedTrait<S> |
value |
TraitValue<S> |
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”setTrait<
T>(writer,target,trait,value):void
Sets target’s trait to value: an entity’s, or the world’s for a
world trait. A trait of fields takes the fields to change; a factory
trait’s value is copied into the record it keeps, so a writer that
keeps and changes its own object changes nothing. The first argument
is what may write it: a trait the room streams takes an authority, the
room’s step or requireAuthority(world); a Reach.Local or Reach.Authority
trait takes any step; a predicted trait takes a predicted step, on the
PredictedEntity it hands out. The target holds the trait already:
addTrait adds one. It tells the trait’s watchers, as koota’s set
does. As Unity’s EntityManager.SetComponentData.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends UnstreamedTrait |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
writer |
EntityAuthority | SystemStep |
target |
Target |
trait |
T |
value |
TraitValue<ExtractSchema<T>> |
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”setTrait<
T>(writer,target,trait,value):void
Sets target’s trait to value: an entity’s, or the world’s for a
world trait. A trait of fields takes the fields to change; a factory
trait’s value is copied into the record it keeps, so a writer that
keeps and changes its own object changes nothing. The first argument
is what may write it: a trait the room streams takes an authority, the
room’s step or requireAuthority(world); a Reach.Local or Reach.Authority
trait takes any step; a predicted trait takes a predicted step, on the
PredictedEntity it hands out. The target holds the trait already:
addTrait adds one. It tells the trait’s watchers, as koota’s set
does. As Unity’s EntityManager.SetComponentData.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends AnyEntityPredictedTrait |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
writer |
PredictedStep |
target |
PredictedEntity |
trait |
T |
value |
TraitValue<ExtractSchema<T>> |
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”setTrait<
T>(writer,target,trait,value):void
Sets target’s trait to value: an entity’s, or the world’s for a
world trait. A trait of fields takes the fields to change; a factory
trait’s value is copied into the record it keeps, so a writer that
keeps and changes its own object changes nothing. The first argument
is what may write it: a trait the room streams takes an authority, the
room’s step or requireAuthority(world); a Reach.Local or Reach.Authority
trait takes any step; a predicted trait takes a predicted step, on the
PredictedEntity it hands out. The target holds the trait already:
addTrait adds one. It tells the trait’s watchers, as koota’s set
does. As Unity’s EntityManager.SetComponentData.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends Trait |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
writer |
EntityAuthority |
target |
Entity |
trait |
T |
value |
TraitValue<ExtractSchema<T>> |
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”setTrait<
T>(writer,target,trait,value):void
Sets target’s trait to value: an entity’s, or the world’s for a
world trait. A trait of fields takes the fields to change; a factory
trait’s value is copied into the record it keeps, so a writer that
keeps and changes its own object changes nothing. The first argument
is what may write it: a trait the room streams takes an authority, the
room’s step or requireAuthority(world); a Reach.Local or Reach.Authority
trait takes any step; a predicted trait takes a predicted step, on the
PredictedEntity it hands out. The target holds the trait already:
addTrait adds one. It tells the trait’s watchers, as koota’s set
does. As Unity’s EntityManager.SetComponentData.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends Trait |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
writer |
Authority |
target |
World |
trait |
T |
value |
TraitValue<ExtractSchema<T>> |
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”setTrait<
T>(writer,target,trait,value):void
Sets target’s trait to value: an entity’s, or the world’s for a
world trait. A trait of fields takes the fields to change; a factory
trait’s value is copied into the record it keeps, so a writer that
keeps and changes its own object changes nothing. The first argument
is what may write it: a trait the room streams takes an authority, the
room’s step or requireAuthority(world); a Reach.Local or Reach.Authority
trait takes any step; a predicted trait takes a predicted step, on the
PredictedEntity it hands out. The target holds the trait already:
addTrait adds one. It tells the trait’s watchers, as koota’s set
does. As Unity’s EntityManager.SetComponentData.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends Trait |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
writer |
SetupWriter |
target |
Target |
trait |
T |
value |
TraitValue<ExtractSchema<T>> |
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”setTrait<
T>(writer,target,trait,value):void
Sets target’s trait to value: an entity’s, or the world’s for a
world trait. A trait of fields takes the fields to change; a factory
trait’s value is copied into the record it keeps, so a writer that
keeps and changes its own object changes nothing. The first argument
is what may write it: a trait the room streams takes an authority, the
room’s step or requireAuthority(world); a Reach.Local or Reach.Authority
trait takes any step; a predicted trait takes a predicted step, on the
PredictedEntity it hands out. The target holds the trait already:
addTrait adds one. It tells the trait’s watchers, as koota’s set
does. As Unity’s EntityManager.SetComponentData.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends LocalTrait |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
writer |
ViewWriter | EntityAuthority | SystemStep |
target |
Target |
trait |
T |
value |
TraitValue<ExtractSchema<T>> |
Returns
Section titled “Returns”void