private void battle() throws IOException {

            boolean end =false;
            String line = null;
            while(!end && !closed){
                //все что в цикле сугубо для того чтоб комп не вис)
                line = inputStream.readUTF();

                if(line.equals("$lost$")){
                    this.lost = true;

                } else if (line.equals("m")){
                    this.X = inputStream.readFloat();
                    this.Y = inputStream.readFloat();
                    this.bitmapAngle = inputStream.readFloat();
                    this.targetX = inputStream.readFloat();
                    this.targetY = inputStream.readFloat();

                } else if (line.equals("$fire$")){
                    fired = true;
                    this.xFire = inputStream.readFloat();
                    this.yFire = inputStream.readFloat();
                }else if(line.equals("$stop$")){
                    end =true;
                }else
                    close();
            }
        }