Ejemplo n.º 1
0
    public void AddEntity(Entity entity, Position roomPos, Position posInRoom, bool shouldCameraFollow = false)
    {
        entity.Id = GenerateId();

        entities.Add(entity.Id, entity);
        if (entity is ITickable)
        {
            tickables.Add((ITickable)entity);
        }

        //scales the size with accuracy
        entity.SetSize(entity.Size, this, true);

        //if(entity.Size.x > 0 || entity.Size.y > 0)
        entity.SetCurrentRoom(roomPos, this);
        entity.SetPositionInRoom(posInRoom, this, true);

        WorldRenderer.AddEntity(entity, this, shouldCameraFollow);
    }