Skip to content

Commit

Permalink
small typos fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
srcimon committed Feb 23, 2025
1 parent c820788 commit f2a029f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/docs/core-modules/mouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mouse.unitsScrolled();

The `CursorAttachmentComponent` can be used to attach any entity to the mouse cursor position in the game world.

```java
``` java
environment.addEntity(new Entity()
.name("animated-cursort")
.add(new TransformComponent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import io.github.srcimon.screwbox.core.window.Window;

import static java.util.Objects.requireNonNull;

/**
* Best game engine ever made (not). The entry point for starting a game via {@link ScrewBox#createEngine()}.
*
* @see <a href="https://screwbox.dev">Documentation</a>
* @see #createEngine()
*/
public final class ScrewBox {
Expand All @@ -26,6 +29,7 @@ public static Engine createEngine() {
* {@link Window#title()}.
*/
public static Engine createEngine(final String name) {
requireNonNull(name, "name must not be null");
return new DefaultEngine(name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface Light {
/**
* Adds a directed light to the {@link World}. Cone lights cast shadows.
*
* @param position position of the lightsource in the map
* @param position position of the light source in the map
* @param direction the direction of the light
* @param cone the cone size of the light
* @param radius the radius of the light
Expand All @@ -29,9 +29,9 @@ public interface Light {
Light addConeLight(Vector position, Rotation direction, Rotation cone, double radius, Color color);

/**
* Adds a pointlight to the {@link World}. Pointlights cast shadows.
* Adds a point light to the {@link World}. Pointlights cast shadows.
*
* @param position position of the lightsource in the map
* @param position position of the light source in the map
* @param radius the radius of the light
* @param color the {@link Color} of the light
*/
Expand All @@ -40,7 +40,7 @@ public interface Light {
/**
* Adds a spotlight to the {@link World}. Spotlights don't cast any shadow.
*
* @param position position of the lightsource in the map
* @param position position of the light source in the map
* @param radius the radius of the light
* @param color the {@link Color} of the light
*/
Expand Down Expand Up @@ -68,7 +68,7 @@ default Light addShadowCaster(Bounds shadowCaster) {
Light addShadowCaster(Bounds shadowCaster, boolean selfShadow);

/**
* Adds illumintation to this area even when there are shadow casters at the same area. Used to support light effects
* Adds illumination to this area even when there are shadow casters at the same area. Used to support light effects
* on orthographic walls. Can be automated by adding a {@link OrthographicWallComponent} to an {@link Entity}.
*
* @since 2.9.0
Expand Down Expand Up @@ -107,7 +107,7 @@ default Light addShadowCaster(Bounds shadowCaster) {
Light addGlow(Vector position, double radius, Color color);

/**
* Renders the lightmap to all {@link Viewport viewports}. Can be automated by using {@link LightRenderSystem}.
* Renders the light map to all {@link Viewport viewports}. Can be automated by using {@link LightRenderSystem}.
*
* @see LightRenderSystem
* @see Environment#enableLight()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.github.srcimon.screwbox.core;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThatThrownBy;

class ScrewBoxTest {

@Test
void createEngine_nameIsNull_throwsException() {
assertThatThrownBy(() -> ScrewBox.createEngine(null))
.isInstanceOf(NullPointerException.class)
.hasMessage("name must not be null");
}
}

0 comments on commit f2a029f

Please sign in to comment.