2019-06-18 22:55:32 -04:00
/ *
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Copyright ( C ) 2015 - 2019 Project Meteor Dev Team
This file is part of Project Meteor Server .
Project Meteor Server is free software : you can redistribute it and / or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
Project Meteor Server is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU Affero General Public License for more details .
You should have received a copy of the GNU Affero General Public License
along with Project Meteor Server . If not , see < https : www . gnu . org / licenses / > .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* /
using FFXIVClassic_Map_Server.actors.director ;
2017-04-29 20:30:54 -04:00
using FFXIVClassic_Map_Server.Actors ;
using FFXIVClassic_Map_Server.lua ;
using System ;
2017-04-15 16:33:56 -04:00
namespace FFXIVClassic_Map_Server.actors.area
{
2019-05-06 13:39:24 -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 ( )
{
2017-08-23 03:08:43 +01:00
lock ( mActorList )
2017-04-29 20:30:54 -04:00
{
2017-08-23 03:08:43 +01:00
if ( isContentFinished )
2017-04-29 20:30:54 -04:00
{
2017-08-23 03:08:43 +01:00
bool noPlayersLeft = true ;
foreach ( Actor a in mActorList . Values )
{
if ( a is Player )
noPlayersLeft = false ;
}
if ( noPlayersLeft )
GetParentZone ( ) . DeleteContentArea ( this ) ;
2017-04-29 20:30:54 -04:00
}
2017-08-23 03:08:43 +01:00
}
2017-04-29 20:30:54 -04:00
}
2017-04-15 16:33:56 -04:00
}
}