2017-04-29 20:30:54 -04:00
using FFXIVClassic_Map_Server.actors.director ;
using FFXIVClassic_Map_Server.actors.group ;
using FFXIVClassic_Map_Server.Actors ;
using FFXIVClassic_Map_Server.lua ;
using System ;
2017-04-15 16:33:56 -04:00
using System.Collections.Generic ;
using System.Linq ;
using System.Text ;
using System.Threading.Tasks ;
namespace FFXIVClassic_Map_Server.actors.area
{
2017-04-29 20:30:54 -04:00
2017-04-15 16:33:56 -04:00
class PrivateAreaContent : PrivateArea
{
2017-04-29 20:30:54 -04:00
private Director currentDirector ;
private bool isContentFinished = false ;
public static PrivateAreaContent CreateContentArea ( String scriptPath )
{
return null ;
}
public PrivateAreaContent ( Zone parent , string classPath , string privateAreaName , uint privateAreaType , Director director , Player contentStarter ) //TODO: Make it a list
: base ( parent , parent . actorId , classPath , privateAreaName , privateAreaType , 0 , 0 , 0 )
{
currentDirector = director ;
2017-07-09 18:38:01 -04:00
LuaEngine . GetInstance ( ) . CallLuaFunction ( contentStarter , this , "onCreate" , false , currentDirector ) ;
2017-04-29 20:30:54 -04:00
}
public Director GetContentDirector ( )
{
return currentDirector ;
}
public void ContentFinished ( )
{
isContentFinished = true ;
}
public void CheckDestroy ( )
{
if ( isContentFinished )
{
bool noPlayersLeft = true ;
foreach ( Actor a in mActorList . Values )
{
if ( a is Player )
noPlayersLeft = false ;
}
if ( noPlayersLeft )
GetParentZone ( ) . DeleteContentArea ( this ) ;
}
}
2017-04-15 16:33:56 -04:00
}
}