process UpdateNode effect
| 364 | |
| 365 | // process UpdateNode effect |
| 366 | static void ApplyUpdateNode |
| 367 | ( |
| 368 | FILE *stream, // effects stream |
| 369 | GraphContext *gc // graph to operate on |
| 370 | ) { |
| 371 | //-------------------------------------------------------------------------- |
| 372 | // effect format: |
| 373 | // entity ID |
| 374 | // attribute ID |
| 375 | // attribute value |
| 376 | //-------------------------------------------------------------------------- |
| 377 | |
| 378 | SIValue v; // updated value |
| 379 | uint props_set; // number of attributes updated |
| 380 | uint props_removed; // number of attributes removed |
| 381 | Attribute_ID attr_id; // entity ID |
| 382 | |
| 383 | EntityID id = INVALID_ENTITY_ID; |
| 384 | |
| 385 | //-------------------------------------------------------------------------- |
| 386 | // read node ID |
| 387 | //-------------------------------------------------------------------------- |
| 388 | |
| 389 | fread_assert(&id, sizeof(EntityID), stream); |
| 390 | |
| 391 | //-------------------------------------------------------------------------- |
| 392 | // read attribute ID |
| 393 | //-------------------------------------------------------------------------- |
| 394 | |
| 395 | fread_assert(&attr_id, sizeof(Attribute_ID), stream); |
| 396 | |
| 397 | //-------------------------------------------------------------------------- |
| 398 | // read attribute ID |
| 399 | //-------------------------------------------------------------------------- |
| 400 | |
| 401 | v = SIValue_FromBinary(stream); |
| 402 | ASSERT(SI_TYPE(v) & (SI_VALID_PROPERTY_VALUE | T_NULL)); |
| 403 | ASSERT((attr_id != ATTRIBUTE_ID_ALL || SIValue_IsNull(v)) && attr_id != ATTRIBUTE_ID_NONE); |
| 404 | |
| 405 | UpdateNodeProperty(gc, id, attr_id, v); |
| 406 | } |
| 407 | |
| 408 | // process DeleteNode effect |
| 409 | static void ApplyDeleteNode |
no test coverage detected