// file name : ele10.cpp
#include\"stdafx.h\"
#include\"ele.h\"

 

 

#ifndef CONIO
#define CONIO
#include<conio.h>
#endif

#ifndef STDIO
#define STDIO
#include<stdio.h>
#endif

Container1::Container1(int max, int floor = 1):
Container(max, floor)
{
 dContainer();
}

void Container1::dContainer()
{
 int x,y;

 x = 32;
 y = -2 * GetFloor() + 19;

 if( GetContainerState() == MovingUp )
  y--;

 if( GetContainerState() == MovingDown )
  y++;

 gotoxy(x,y-2);
 printf(\"   \");
 gotoxy(x, y - 1);
 printf(\"   \");
 gotoxy(x, y + 3);
 printf(\"   \");
 gotoxy(x, y + 4);
 printf(\"   \");

 switch ( GetDoorState() )
 {
  case Opened:
   gotoxy(x, y);
   printf(\"%c%c%c\",214,205,184);
   gotoxy(x, y+1);
   printf(\"%c%c%c\",186,\' \',186);
   gotoxy(x, y+2);
   printf(\"%c%c%c\",211,205,189);
   break;
  case Opening:
  case Closing:
   gotoxy(x, y);
   printf(\"%c%c%c\",218,210,191);
   gotoxy(x, y+1);
   printf(\"%c%c%c\",179,186,179);
   gotoxy(x, y+2);
   printf(\"%c%c%c\",192,208,217);
   break;
  case Closed:
   gotoxy(x, y);
   printf(\"%c%c%c\",218,196,191);
   gotoxy(x, y+1);
   printf(\"%c%c%c\",179,\' \',179);
   gotoxy(x, y+2);
   printf(\"%c%c%c\",192,196,217);
   break;
 }
}

void Container1::dDoor()
{
 dContainer();
}

void Container1::dButton()
{
 int i;
 for( i = 1; i <= 7; i++ )
 {
  gotoxy(12, i+6);
  if( GetButton(i) != 0 )
   printf(\"%c\", 2);
  else
   printf(\" \");
 }

 gotoxy(16,10);
 printf(\"in Elevator\");
 gotoxy(18, 11);
 printf(\"%d person(s)\", GetNumber());
}

Container2::Container2(int max, int floor = 7):
Container(max, floor)
{
 dContainer();
}
void Container2::dContainer()
{
 int x,y;

 x = 45;
 y = -2 * GetFloor() + 19;

 if( GetContainerState() == MovingUp )
  y--;

 if( GetContainerState() == MovingDown )
  y++;

 gotoxy(x, y - 2);
 printf(\"   \");
 gotoxy(x, y - 1);
 printf(\"   \");
 gotoxy(x, y + 3);
 printf(\"   \");
 gotoxy(x, y + 4);
 printf(\"   \");

 switch ( GetDoorState() )
 {
  case Opened:
   gotoxy(x, y);
   printf(\"%c%c%c\",214,205,184);
   gotoxy(x, y+1);
   printf(\"%c%c%c\",186,\' \',186);
   gotoxy(x, y+2);
   printf(\"%c%c%c\",211,205,189);
   break;
  case Opening:
  case Closing:
   gotoxy(x, y);
   printf(\"%c%c%c\",218,210,191);
   gotoxy(x, y+1);
   printf(\"%c%c%c\",179,186,179);
   gotoxy(x, y+2);
   printf(\"%c%c%c\",192,208,217);
   break;
  case Closed:
   gotoxy(x, y);
   printf(\"%c%c%c\",218,196,191);
   gotoxy(x, y+1);
   printf(\"%c%c%c\",179,\' \',179);
   gotoxy(x, y+2);
   printf(\"%c%c%c\",192,196,217);
   break;
 }
}


void Container2::dDoor()
{
 dContainer();
}

void Container2::dButton()
{
 int i;

 for( i = 1; i <= 7; i++ )
 {
  gotoxy(69, i+6);
  if( GetButton(i) != 0 )
   printf(\"%c\", 2);
  else
   printf(\" \");
 }

 gotoxy( 51, 10);
 printf(\"in Elevator\");
 gotoxy( 53, 11);
 printf(\"%d person(s)\", GetNumber());
}


////////////////

ㅠㅠ울고있습니다