diff --git a/ashley/src/com/badlogic/ashley/systems/IntervalSystem.java b/ashley/src/com/badlogic/ashley/systems/IntervalSystem.java index a3dd4095..09659df2 100644 --- a/ashley/src/com/badlogic/ashley/systems/IntervalSystem.java +++ b/ashley/src/com/badlogic/ashley/systems/IntervalSystem.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright 2014 See AUTHORS file. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -44,6 +44,10 @@ public IntervalSystem (float interval, int priority) { this.accumulator = 0; } + public float getInterval() { + return interval; + } + @Override public final void update (float deltaTime) { accumulator += deltaTime; diff --git a/ashley/tests/com/badlogic/ashley/systems/IntervalSystemTest.java b/ashley/tests/com/badlogic/ashley/systems/IntervalSystemTest.java index afac5172..0ea236c0 100644 --- a/ashley/tests/com/badlogic/ashley/systems/IntervalSystemTest.java +++ b/ashley/tests/com/badlogic/ashley/systems/IntervalSystemTest.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright 2014 See AUTHORS file. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,4 +50,10 @@ public void intervalSystem () { assertEquals(i / 2, intervalSystemSpy.numUpdates); } } + + @Test + public void testGetInterval () { + IntervalSystemSpy intervalSystemSpy = new IntervalSystemSpy(); + assertEquals(intervalSystemSpy.getInterval(), deltaTime * 2.0f, 0); + } }