add a node add label effect to buffer
| 654 | |
| 655 | // add a node add label effect to buffer |
| 656 | void EffectsBuffer_AddSetRemoveLabelsEffect |
| 657 | ( |
| 658 | EffectsBuffer *buff, // effect buffer |
| 659 | const Node *node, // updated node |
| 660 | const LabelID *lbl_ids, // labels |
| 661 | uint8_t lbl_count, // number of labels |
| 662 | EffectType t // effect type |
| 663 | ) { |
| 664 | //-------------------------------------------------------------------------- |
| 665 | // effect format: |
| 666 | // effect type |
| 667 | // node ID |
| 668 | // labels count |
| 669 | // label IDs |
| 670 | //-------------------------------------------------------------------------- |
| 671 | |
| 672 | EffectsBuffer_WriteBytes(&t, sizeof(t), buff); |
| 673 | |
| 674 | // write node ID |
| 675 | EffectsBuffer_WriteBytes(&ENTITY_GET_ID(node), sizeof(EntityID), buff); |
| 676 | |
| 677 | // write labels count |
| 678 | EffectsBuffer_WriteBytes(&lbl_count, sizeof(lbl_count), buff); |
| 679 | |
| 680 | // write label IDs |
| 681 | EffectsBuffer_WriteBytes(lbl_ids, sizeof(LabelID) * lbl_count, buff); |
| 682 | |
| 683 | EffectsBuffer_IncEffectCount(buff); |
| 684 | } |
| 685 | |
| 686 | // add a node add labels effect to buffer |
| 687 | void EffectsBuffer_AddLabelsEffect |
no test coverage detected