坦克大战(一期)-设计模式-调整项目结构

DesignPatterns
bingor 2 years ago
parent 609e8526aa
commit bc16e1a196

@ -1,5 +1,10 @@
package com.msb;
import com.msb.base.PropertyMgr;
import com.msb.enums.DirEnum;
import com.msb.enums.GroupEnum;
import com.msb.model.Tank;
import java.util.Random;
/**

@ -1,5 +1,11 @@
package com.msb;
import com.msb.enums.DirEnum;
import com.msb.enums.GroupEnum;
import com.msb.model.Bullet;
import com.msb.model.Explode;
import com.msb.model.Tank;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
@ -20,9 +26,9 @@ public class TankFrame extends Frame {
Tank myTank = new Tank(100, 500, DirEnum.RIGHT, GroupEnum.GOOD, this);
// Explode explode = new Explode(100, 100, this);
// Bullet bullet = new Bullet(200, 200, DirEnum.DOWN);
List<Bullet> bullets = new ArrayList<>();
List<Tank> tanks = new ArrayList<>(); //敌方坦克
List<Explode> explodes = new ArrayList<>(); //爆炸效果
public List<Bullet> bullets = new ArrayList<>();
public List<Tank> tanks = new ArrayList<>(); //敌方坦克
public List<Explode> explodes = new ArrayList<>(); //爆炸效果
public static final int GAME_WIDTH = 1000;
public static final int GAME_HEIGHT = 800;

@ -1,7 +1,6 @@
package com.msb;
package com.msb.base;
import java.io.IOException;
import java.util.Objects;
import java.util.Properties;
/**

@ -1,6 +1,6 @@
package com.msb;
package com.msb.base;
import com.msb.util.ImageUtil;
import com.msb.utils.ImageUtil;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 15:40
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 16:42
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 15:41
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 15:39
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 16:43
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 16:23
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 16:55
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 16:44
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.abstractFactory;/**
package com.msb.base.dp.abstractFactory;/**
* @Author bingor
* @Date 2022/10/8 16:43
* @Description: com.msb.abstractFactory

@ -1,4 +1,4 @@
package com.msb.factory;/**
package com.msb.base.dp.factory;/**
* @Author bingor
* @Date 2022/10/8 14:49
* @Description: com.msb.factory

@ -1,4 +1,4 @@
package com.msb.factory;/**
package com.msb.base.dp.factory;/**
* @Author bingor
* @Date 2022/10/8 15:08
* @Description: com.msb.factory

@ -1,4 +1,4 @@
package com.msb.factory;/**
package com.msb.base.dp.factory;/**
* @Author bingor
* @Date 2022/10/8 14:51
* @Description: com.msb.factory

@ -1,4 +1,4 @@
package com.msb.factory;
package com.msb.base.dp.factory;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.factory;/**
package com.msb.base.dp.factory;/**
* @Author bingor
* @Date 2022/10/8 14:49
* @Description: com.msb.factory

@ -1,4 +1,4 @@
package com.msb.factory;/**
package com.msb.base.dp.factory;/**
* @Author bingor
* @Date 2022/10/8 15:04
* @Description: com.msb.factory

@ -1,4 +1,4 @@
package com.msb.singleton;
package com.msb.base.dp.singleton;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.singleton;
package com.msb.base.dp.singleton;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.singleton;
package com.msb.base.dp.singleton;
import java.util.Objects;

@ -1,4 +1,4 @@
package com.msb.singleton;
package com.msb.base.dp.singleton;
import java.util.Objects;

@ -1,4 +1,4 @@
package com.msb.singleton;
package com.msb.base.dp.singleton;
import java.util.Objects;

@ -1,4 +1,4 @@
package com.msb.singleton;
package com.msb.base.dp.singleton;
import java.util.Objects;

@ -1,6 +1,4 @@
package com.msb.singleton;
import java.util.Objects;
package com.msb.base.dp.singleton;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.singleton;
package com.msb.base.dp.singleton;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
import java.util.Arrays;

@ -1,4 +1,4 @@
package com.msb.strategy;
package com.msb.base.dp.strategy;
import java.util.Arrays;

@ -1,4 +1,4 @@
package com.msb;
package com.msb.enums;
/**
* @Author bingor

@ -1,4 +1,4 @@
package com.msb;
package com.msb.enums;
/**
* @Author bingor

@ -1,4 +1,6 @@
package com.msb;
package com.msb.inter;
import com.msb.model.Tank;
/**
* @Author bingor

@ -1,10 +1,14 @@
package com.msb;/**
package com.msb.inter.impl;/**
* @Author bingor
* @Date 2022/10/8 11:21
* @Description: com.msb
* @Version: 1.0
*/
import com.msb.model.Bullet;
import com.msb.model.Tank;
import com.msb.inter.FireStrategy;
/**
*@ClassName DefaultFireStrategy
*@Description TODO

@ -1,10 +1,15 @@
package com.msb;/**
package com.msb.inter.impl;/**
* @Author bingor
* @Date 2022/10/8 11:21
* @Description: com.msb
* @Version: 1.0
*/
import com.msb.model.Bullet;
import com.msb.model.Tank;
import com.msb.enums.DirEnum;
import com.msb.inter.FireStrategy;
/**
*@ClassName DefaultFireStrategy
*@Description TODO

@ -1,4 +1,9 @@
package com.msb;
package com.msb.model;
import com.msb.TankFrame;
import com.msb.base.ResourcesMgr;
import com.msb.enums.DirEnum;
import com.msb.enums.GroupEnum;
import java.awt.*;

@ -1,4 +1,7 @@
package com.msb;
package com.msb.model;
import com.msb.TankFrame;
import com.msb.base.ResourcesMgr;
import java.awt.*;

@ -1,4 +1,11 @@
package com.msb;
package com.msb.model;
import com.msb.TankFrame;
import com.msb.base.PropertyMgr;
import com.msb.base.ResourcesMgr;
import com.msb.enums.DirEnum;
import com.msb.enums.GroupEnum;
import com.msb.inter.FireStrategy;
import java.awt.*;
import java.util.Random;

@ -1,4 +1,4 @@
package com.msb.util;
package com.msb.utils;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

@ -6,5 +6,5 @@ gameWidth=1080
gameHeight=720
#fireStrategy
goodFS=com.msb.FourFireStrategy
badFS=com.msb.DefaultFireStrategy
goodFS=com.msb.inter.impl.FourFireStrategy
badFS=com.msb.inter.impl.DefaultFireStrategy

@ -1,4 +1,4 @@
import com.msb.DirEnum;
import com.msb.enums.DirEnum;
import org.junit.Assert;
import org.junit.Test;

Loading…
Cancel
Save