import java.awt.Graphics;
/* 
 Program: 	Actor class
 Purpose: 	an actor for plays
 @author 	john@december.com 
 @version	1.60; 26 Nov 95
 */

class Actor {

   //-- Class variable
   static int actorLines = 0;          // lines all actors have said 

   //-- Private variables
   private int lineCount = 0;          // number of lines this actor has said
   private int stagePosition = 0;      // where actor's lines appear 
   private int leftMargin = 0;         // left margin for actor's name
   private int lineMargin = 0;         // left margin for actor's spoken lines
   private String actorName = "?";     // actor's stage name
   private String nextLine = "?";      // the actor's next utterance

   //-- Constructors

   Actor () {                         // minimum actor creation
      lineCount = 0;
   }

   Actor (String name) { 
      this();
      actorName = name;
   }

   Actor (String name, int left, int line, int position) {  // max actor creation
      this(name);
      leftMargin = left;
      lineMargin = line;
      stagePosition = position;
   }

   //-- Methods

   public void paint(Graphics context){
      context.drawString(actorName, leftMargin, stagePosition);
      context.drawString(nextLine, lineMargin, stagePosition);  
   }

   public void setMargins(int left, int line){  
      leftMargin = left;
      lineMargin = line;
   }

   public void setPosition(int position){  
      stagePosition = position;
   }

   public int linesSaid(){  
      return (lineCount);
   }

   public void say(String line) {
      nextLine = line;
      lineCount++;
      actorLines++;
   }
}
