package csa.tiletools.worldgen.mapgen.miny.render;

import csa.tiletools.worldgen.mapgen.miny.render.BB.BoundingBox;
import csa.tiletools.worldgen.mapgen.miny.render.BB.LineBB;

public class Line extends Drawable
{
  float px1;
  float px2;
  float py1;
  float py2;
  float weight;
  float fallout;
  int c;
  LineBB bb;

  public Line(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, int paramInt)
  {
    this.px1 = paramFloat1;
    this.py1 = paramFloat2;
    this.px2 = paramFloat3;
    this.py2 = paramFloat4;
    this.weight = (paramFloat5 / 2.0F);
    this.fallout = paramFloat6;
    this.c = paramInt;
    this.bb = new LineBB(this.px1, this.py1, this.px2, this.py2, this.weight + this.fallout);
  }

    @Override
  public BoundingBox getBoundingBox()
  {
    return this.bb;
  }

    @Override
  public int getColor(float paramFloat1, float paramFloat2)
  {
    float f = RenderUtils.distanceToLine(paramFloat1, paramFloat2, this.px1, this.py1, this.px2, this.py2);
    return RenderUtils.multAlpha(this.c, 1.0F - RenderUtils.smoothstep(f, this.weight, this.weight + this.fallout));
  }
}
