mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-12 10:13:46 +00:00
Reformat rest of the design patterns - Issue #224
This commit is contained in:
1 parent
449340bd2b
commit
306b1f3d31
337 files changed
+6740
-6847
No files matched your search
@@ -7,32 +7,36 @@ package com.iluwatar.doubledispatch;
|
||||
*/
|
||||
public class Meteoroid extends GameObject {
|
||||
|
||||
public Meteoroid(int left, int top, int right, int bottom) {
|
||||
super(left, top, right, bottom);
|
||||
}
|
||||
public Meteoroid(int left, int top, int right, int bottom) {
|
||||
super(left, top, right, bottom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collision(GameObject gameObject) {
|
||||
gameObject.collisionResolve(this);
|
||||
}
|
||||
@Override
|
||||
public void collision(GameObject gameObject) {
|
||||
gameObject.collisionResolve(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(FlamingAsteroid asteroid) {
|
||||
System.out.println(String.format("%s hits %s.", asteroid.getClass().getSimpleName(), this.getClass().getSimpleName()));
|
||||
}
|
||||
@Override
|
||||
public void collisionResolve(FlamingAsteroid asteroid) {
|
||||
System.out.println(String.format("%s hits %s.", asteroid.getClass().getSimpleName(), this
|
||||
.getClass().getSimpleName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(Meteoroid meteoroid) {
|
||||
System.out.println(String.format("%s hits %s.", meteoroid.getClass().getSimpleName(), this.getClass().getSimpleName()));
|
||||
}
|
||||
@Override
|
||||
public void collisionResolve(Meteoroid meteoroid) {
|
||||
System.out.println(String.format("%s hits %s.", meteoroid.getClass().getSimpleName(), this
|
||||
.getClass().getSimpleName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationMir mir) {
|
||||
System.out.println(String.format("%s hits %s.", mir.getClass().getSimpleName(), this.getClass().getSimpleName()));
|
||||
}
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationMir mir) {
|
||||
System.out.println(String.format("%s hits %s.", mir.getClass().getSimpleName(), this.getClass()
|
||||
.getSimpleName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationIss iss) {
|
||||
System.out.println(String.format("%s hits %s.", iss.getClass().getSimpleName(), this.getClass().getSimpleName()));
|
||||
}
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationIss iss) {
|
||||
System.out.println(String.format("%s hits %s.", iss.getClass().getSimpleName(), this.getClass()
|
||||
.getSimpleName()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user