Ejemplo n.º 1
0
    public void ReplaceWorldState(ushort newEntityCount, NetStack.Serialization.BitBuffer newBuffer)
    {
        var index     = GameComponentsLookup.WorldState;
        var component = (WorldState)CreateComponent(index, typeof(WorldState));

        component.EntityCount = newEntityCount;
        component.Buffer      = newBuffer;
        ReplaceComponent(index, component);
    }
Ejemplo n.º 2
0
    public void ReplaceClientDataBuffer(ushort newCommandCount, NetStack.Serialization.BitBuffer newValue)
    {
        var index     = GameComponentsLookup.ClientDataBuffer;
        var component = (ClientDataBuffer)CreateComponent(index, typeof(ClientDataBuffer));

        component.CommandCount = newCommandCount;
        component.Value        = newValue;
        ReplaceComponent(index, component);
    }
Ejemplo n.º 3
0
    public GameEntity SetWorldState(ushort newEntityCount, NetStack.Serialization.BitBuffer newBuffer)
    {
        if (hasWorldState)
        {
            throw new Entitas.EntitasException("Could not set WorldState!\n" + this + " already has an entity with WorldState!",
                                               "You should check if the context already has a worldStateEntity before setting it or use context.ReplaceWorldState().");
        }
        var entity = CreateEntity();

        entity.AddWorldState(newEntityCount, newBuffer);
        return(entity);
    }
Ejemplo n.º 4
0
    public void ReplaceWorldState(ushort newEntityCount, NetStack.Serialization.BitBuffer newBuffer)
    {
        var entity = worldStateEntity;

        if (entity == null)
        {
            entity = SetWorldState(newEntityCount, newBuffer);
        }
        else
        {
            entity.ReplaceWorldState(newEntityCount, newBuffer);
        }
    }