using System;
using System.Reflection;
using System.Windows.Forms;
using System.Drawing;
using System.Threading;
using System.Globalization;
using System.Collections.Generic;
using Styx.Combat.CombatRoutine;
using Styx.Helpers;
using Styx.Plugins.PluginClass;
using TreeSharp;
namespace Vagabond
{
public class VagabondLoader : CombatRoutine
{
private readonly CombatRoutine CC;
public VagabondLoader()
{
try
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
string path = Logging.ApplicationPath + @"\CustomClasses\Vagabond.dll";
Assembly asm = Assembly.LoadFrom(path);
if (asm != null)
{
foreach (Type t in asm.GetTypes())
{
if (t.IsSubclassOf(typeof(CombatRoutine)) && t.IsClass)
{
var obj = Activator.CreateInstance(t);
CC = (CombatRoutine)obj;
}
}
}
else
{
Logging.Write(Color.DarkRed, "An error occured while loading Vagabond! asm is null!");
}
}
catch (System.Threading.ThreadAbortException) { throw; }
catch (Exception e)
{
Logging.Write(Color.DarkRed, "An error occured while loading Vagabond!");
Logging.Write(Color.DarkRed,e.ToString());
}
}
#region Overrides of CombatRoutine
public override string Name
{
get { return CC.Name; }
}
public override void Initialize()
{
CC.Initialize();
}
public override WoWClass Class { get { return WoWClass.Rogue; } }
public override void Combat()
{
CC.Combat();
}
public override void Pulse()
{
CC.Pulse();
}
public override void Pull()
{
CC.Pull();
}
public override void PreCombatBuff()
{
CC.PreCombatBuff();
}
public override bool NeedPreCombatBuffs
{
get { return CC.NeedPreCombatBuffs; }
}
public override bool NeedHeal
{
get { return CC.NeedHeal; }
}
public override void Heal()
{
CC.Heal();
}
public override void OnButtonPress()
{
CC.OnButtonPress();
}
public override bool WantButton { get { return true; } }
public override bool NeedPullBuffs { get { return false; } }
public override bool NeedCombatBuffs { get { return false; } }
public override void Rest()
{
CC.Rest();
}
public override bool NeedRest
{
get { return CC.NeedRest; }
}
#endregion
}
}