Example #1
0
    public void ReplaceTime(long newFrameCount, ITimeDrive newTimeDrive)
    {
        var index     = GameComponentsLookup.Time;
        var component = (TimeComponent)CreateComponent(index, typeof(TimeComponent));

        component.FrameCount = newFrameCount;
        component.TimeDrive  = newTimeDrive;
        ReplaceComponent(index, component);
    }
Example #2
0
    public GameEntity SetTime(long newFrameCount, ITimeDrive newTimeDrive)
    {
        if (hasTime)
        {
            throw new Entitas.EntitasException("Could not set Time!\n" + this + " already has an entity with TimeComponent!",
                                               "You should check if the context already has a timeEntity before setting it or use context.ReplaceTime().");
        }
        var entity = CreateEntity();

        entity.AddTime(newFrameCount, newTimeDrive);
        return(entity);
    }
Example #3
0
    public void ReplaceTime(long newFrameCount, ITimeDrive newTimeDrive)
    {
        var entity = timeEntity;

        if (entity == null)
        {
            entity = SetTime(newFrameCount, newTimeDrive);
        }
        else
        {
            entity.ReplaceTime(newFrameCount, newTimeDrive);
        }
    }
 public DrivesEntry(ITimeDrive time, ILogDrive log, IInputDrive input)
 {
     Time  = time;
     Log   = log;
     Input = input;
 }
 public TimeSystem(Contexts contexts, ITimeDrive timeDrive)
 {
     _contexts  = contexts;
     _timeDrive = timeDrive;
 }