// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   LiftPlatformOld.java


public class LiftPlatformOld extends LiftPlatformBase
{

    String GetTip()
    {
        return "Move";
    }

    public LiftPlatformOld()
    {
        fFirstMoveDirection = 1.0F;
        bPlayerAbove = false;
        fPlayerAboveEnterTime = 0.0F;
        bPlayerRuning = false;
    }

    void CheckPlayer()
    {
        if(IsPlayerAbove())
        {
            if(bPlayerRuning)
                return;
            if(bPlayerAbove)
            {
                float fAboveInterval = GetTime() - fPlayerAboveEnterTime;
                if(fAboveInterval >= super.fPlatformStartTime)
                {
                    SetStateMoving(GetTime());
                    bPlayerRuning = true;
                }
            } else
            {
                fPlayerAboveEnterTime = GetTime();
                bPlayerAbove = true;
            }
        } else
        {
            bPlayerAbove = false;
            if(bPlayerRuning)
                bPlayerRuning = false;
        }
    }

    void OnCreate()
    {
        super.OnCreate();
        ClearFlag(4);
        ClearFlag(2);
        SetFlag(2048);
        super.sMovingSound = "Data/Sounds/WallDoor_Open";
        super.sStartSound = "Data/Sounds/WallDoor_Open";
        super.sStopSound = "Data/Sounds/WallDoor_Open";
    }

    void Init()
    {
        super.Init();
        super.fMovingDirection = fFirstMoveDirection;
        SetState("Stoped");
        CallMethodEvery("CheckPlayer", 0.5F);
    }

    void Stoped()
    {
        super.bActive = true;
        if(super.nSoundId != -1)
            DetachSound(super.nSoundId);
        CallMethodEveryMinMax("CheckPlayer", 0.5F, 1000F);
    }

    public boolean IsActive(ControlObject Activator)
    {
        return false;
    }

    public float fFirstMoveDirection;
    boolean bPlayerAbove;
    float fPlayerAboveEnterTime;
    boolean bPlayerRuning;
}
