2005-08-02 10:28:41 +04:00
|
|
|
using System;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
namespace AMXXRelease
|
|
|
|
{
|
2005-08-24 06:53:38 +04:00
|
|
|
//Holds information about a plugin
|
2005-08-02 10:28:41 +04:00
|
|
|
public class Plugin
|
|
|
|
{
|
2005-08-24 06:53:38 +04:00
|
|
|
public string name; //Plugin output file name
|
|
|
|
public string source; //Source code file
|
|
|
|
public string options; //Compile-time options
|
|
|
|
public string outdir; //Output folder
|
2005-08-02 10:28:41 +04:00
|
|
|
|
|
|
|
public Plugin(string Name)
|
|
|
|
{
|
|
|
|
name = (string)Name.Clone();
|
|
|
|
source = (string)Name.Clone();
|
|
|
|
outdir = "plugins";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-24 06:53:38 +04:00
|
|
|
//Holds information necessary to compile a module/C++ program
|
2005-08-02 10:28:41 +04:00
|
|
|
public class Module
|
|
|
|
{
|
2005-08-24 06:53:38 +04:00
|
|
|
public string sourcedir; //Source directory
|
|
|
|
public string projname; //Output binary name (such as amxmodx_mm)
|
|
|
|
public string build; //Build configuration
|
|
|
|
public string bindir; //Binary directory
|
|
|
|
public string vcproj; //VCProj file name
|
|
|
|
public string outdir; //Output directory
|
2005-08-02 10:28:41 +04:00
|
|
|
|
|
|
|
public Module()
|
|
|
|
{
|
|
|
|
build = "Release";
|
|
|
|
outdir = "modules";
|
|
|
|
}
|
|
|
|
|
|
|
|
public Module(string name)
|
|
|
|
{
|
|
|
|
build = "Release";
|
|
|
|
outdir = "modules";
|
|
|
|
sourcedir = "dlls\\" + name;
|
|
|
|
projname = name + "_amxx";
|
|
|
|
vcproj = name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-24 06:53:38 +04:00
|
|
|
//Class that represents how a mod wants to be built.
|
|
|
|
//It exports a list of functions, mods, and a few
|
|
|
|
// tidbits of information. It can also hook an extra
|
|
|
|
// step for copying miscellanious files.
|
2005-08-02 10:28:41 +04:00
|
|
|
public abstract class AMod
|
|
|
|
{
|
|
|
|
protected ArrayList m_Modules;
|
|
|
|
protected ArrayList m_Plugins;
|
|
|
|
|
|
|
|
public abstract string GetName();
|
|
|
|
|
|
|
|
public virtual string GetBaseName()
|
|
|
|
{
|
|
|
|
return GetName();
|
|
|
|
}
|
|
|
|
|
|
|
|
public AMod()
|
|
|
|
{
|
|
|
|
m_Modules = new ArrayList();
|
|
|
|
m_Plugins = new ArrayList();
|
|
|
|
}
|
|
|
|
|
2005-08-24 09:19:23 +04:00
|
|
|
//called when it's okay to build an extra dir structure
|
|
|
|
// and copy files to it
|
2005-09-18 07:26:26 +04:00
|
|
|
public virtual bool CopyExtraFiles(ABuilder ab, string basedir, string sourcedir)
|
2005-08-02 10:28:41 +04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-08-24 09:19:23 +04:00
|
|
|
//defines a copy prevention filter
|
|
|
|
public virtual bool ExcludeCopy(string file)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2005-08-02 10:28:41 +04:00
|
|
|
public virtual string GetPluginDir()
|
|
|
|
{
|
|
|
|
return GetName();
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual int GetModules()
|
|
|
|
{
|
|
|
|
return m_Modules.Count;
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual Module GetModule(int i)
|
|
|
|
{
|
|
|
|
return (Module)m_Modules[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual int GetPlugins()
|
|
|
|
{
|
|
|
|
return m_Plugins.Count;
|
|
|
|
}
|
|
|
|
|
2005-08-03 05:14:17 +04:00
|
|
|
public virtual string GetModPath()
|
|
|
|
{
|
|
|
|
return GetName() + "\\addons\\amxmodx";
|
|
|
|
}
|
|
|
|
|
2005-08-02 10:28:41 +04:00
|
|
|
public virtual Plugin GetPlugin(int i)
|
|
|
|
{
|
|
|
|
return (Plugin)m_Plugins[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual Plugin AddPlugin(string name)
|
|
|
|
{
|
|
|
|
Plugin pl = new Plugin(name);
|
|
|
|
m_Plugins.Add(pl);
|
|
|
|
return pl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|