Reorganizes Project (#41)

This commit is contained in:
Kamron Batman 2019-08-02 18:13:40 -07:00 committed by GitHub
parent 08bf44af9a
commit 3614a66aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3499 changed files with 79 additions and 55 deletions

View file

@ -0,0 +1,54 @@
using System;
namespace Server.Engines.MLQuests
{
public class QuestArea
{
public QuestArea(TextDefinition name, string region, Map forceMap = null)
{
Name = name;
RegionName = region;
ForceMap = forceMap;
if (MLQuestSystem.Debug)
ValidationQueue<QuestArea>.Add(this);
}
public TextDefinition Name{ get; set; }
public string RegionName{ get; set; }
public Map ForceMap{ get; set; }
public bool Contains(Mobile mob)
{
return Contains(mob.Region);
}
public bool Contains(Region reg)
{
if (reg == null || ForceMap != null && reg.Map != ForceMap)
return false;
return reg.IsPartOf(RegionName);
}
// Debug method
public void Validate()
{
bool found = false;
foreach (Region r in Region.Regions)
if (r.Name == RegionName && (ForceMap == null || r.Map == ForceMap))
{
found = true;
break;
}
if (!found)
Console.WriteLine("Warning: QuestArea region '{0}' does not exist (ForceMap = {1})", RegionName,
ForceMap == null ? "-null-" : ForceMap.ToString());
}
}
}