Examples of saveComponent()


Examples of org.apache.myfaces.trinidad.context.RequestContext.saveComponent()

      cot.setValue("bar");

      cpgl.getChildren().add(hot);
      cpgl.getChildren().add(cot);

      Object state = context.saveComponent(cpgl);
      UIComponent restored = context.restoreComponent(state);

      assertTrue(restored instanceof CorePanelGroupLayout);
      assertEquals(restored.getChildCount(), 2);
      assertEquals(restored.getAttributes().get("layout"), "horizontal");
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

            inventoryManager.switchItem(blockEntity, blockEntity, i, inventoryItem, i);
        }
        ItemComponent itemComponent = inventoryItem.getComponent(ItemComponent.class);
        if (itemComponent != null && !itemComponent.stackId.isEmpty()) {
            itemComponent.stackId = "";
            inventoryItem.saveComponent(itemComponent);
        }
    }

    @ReceiveEvent(components = {InventoryComponent.class, BlockItemComponent.class})
    public void onPlaced(OnBlockItemPlaced event, EntityRef itemEntity) {
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

        if (!itemTo.exists()) {
            EntityRef fromCopy = CoreRegistry.get(EntityManager.class).copy(itemFrom);

            ItemComponent copyItem = fromCopy.getComponent(ItemComponent.class);
            copyItem.stackCount = (byte) amount;
            fromCopy.saveComponent(copyItem);

            putItemIntoSlot(to, fromCopy, slotTo);

            ItemComponent fromItem = itemFrom.getComponent(ItemComponent.class);
            if (fromItem.stackCount == amount) {
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

        InventoryComponent inventory = entity.getComponent(InventoryComponent.class);
        EntityRef item = inventory.itemSlots.get(slot);
        ItemComponent itemComponent = item.getComponent(ItemComponent.class);
        byte oldSize = itemComponent.stackCount;
        itemComponent.stackCount = (byte) newCount;
        item.saveComponent(itemComponent);
        entity.send(new InventorySlotStackSizeChangedEvent(slot, oldSize, newCount));
    }

}
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

            instigator.send(new InteractionEndEvent(characterComponent.authorizedInteractionId));
        }

        characterComponent.authorizedInteractionTarget = target;
        characterComponent.authorizedInteractionId = event.getActivationId();
        instigator.saveComponent(characterComponent);

    }

    @ReceiveEvent(components = {InteractionTargetComponent.class})
    public void onActivationPredicted(ActivationPredicted event, EntityRef target) {
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

            InteractionUtil.cancelInteractionAsClient(character);
        }
        if (target.exists()) {
            characterComponent.predictedInteractionTarget = target;
            characterComponent.predictedInteractionId = event.getActivationId();
            character.saveComponent(characterComponent);
            target.send(new InteractionStartPredicted(character));
        }
    }

    @ReceiveEvent(components = {CharacterComponent.class}, netFilter = RegisterMode.AUTHORITY)
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

            LocationComponent childLoc = child.getComponent(LocationComponent.class);
            if (childLoc != null) {
                Vector3f oldWorldPos = childLoc.getWorldPosition();
                childLoc.parent = EntityRef.NULL;
                childLoc.setWorldPosition(oldWorldPos);
                child.saveComponent(childLoc);
            }
            childIterator.remove();
        }
    }
}
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

        updateCamera(characterComp, characterMovementComponent, characterComp, location);

        // Hand animation update
        characterComp.handAnimation = Math.max(0, characterComp.handAnimation - 2.5f * delta);

        entity.saveComponent(characterComp);
    }

    private void processInput(EntityRef entity, CharacterComponent characterComponent, CharacterMovementComponent characterMovementComponent) {
        Vector3f relMove = new Vector3f(relativeMovement);
        relMove.y = 0;
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

    @Test
    public void testDeltaLoadChangedComponent() throws Exception {
        EntityRef entity = entityManager.create("test:Test");
        StringComponent comp = entity.getComponent(StringComponent.class);
        comp.value = "Delta";
        entity.saveComponent(comp);
        EntityData.Entity entityData = entitySerializer.serialize(entity);
        entityManager.clear();
        EntityRef loadedEntity = entitySerializer.deserialize(entityData);

        assertTrue(loadedEntity.exists());
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.saveComponent()

        // TODO: Send event for clientInfo creation, don't create here.
        EntityRef clientInfo = entityManager.create("engine:clientInfo");
        DisplayNameComponent displayInfo = clientInfo.getComponent(DisplayNameComponent.class);
        displayInfo.name = name;
        clientInfo.saveComponent(displayInfo);
       
        // mark clientInfo entities with a dedicated component
        ClientInfoComponent cic = new ClientInfoComponent();
        clientInfo.addComponent(cic);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.