amxmodx/plugins/BinLogReader/Plugin.cs

119 lines
1.6 KiB
C#
Raw Normal View History

2006-03-15 16:42:25 +03:00
using System;
using System.Collections;
namespace BinLogReader
{
/// <summary>
/// plugin data
/// </summary>
public class Plugin
{
private byte status;
private string Filename;
private ArrayList Natives;
private ArrayList Publics;
private string title;
private string version;
private int index;
2006-03-15 16:42:25 +03:00
public string File
{
get
{
return Filename;
}
}
public string Title
{
get
{
return title;
}
set
{
title = value;
}
}
public string Version
{
get
{
return version;
}
set
{
version = value;
}
}
public string Status
{
get
{
if (status == 0)
return "Failed";
else if (status == 1)
return "Running";
else if (status == 2)
return "Debug";
return "";
}
}
public int Index
{
get
{
return index;
}
}
public Plugin(string name, int natives, int publics, byte _status, int _index)
2006-03-15 16:42:25 +03:00
{
Filename = name;
Natives = new ArrayList(natives);
Publics = new ArrayList(publics);
status = _status;
index = _index;
2006-03-15 16:42:25 +03:00
}
public void AddNative(string name)
{
Natives.Add(name);
}
public void AddPublic(string pubname)
{
Publics.Add(pubname);
}
public string FindNative(int id)
{
if (id < 0 || id >= Natives.Count)
return null;
return (string)Natives[id];
}
public string FindPublic(int id)
{
if (id < 0 || id >= Publics.Count)
return null;
return (string)Publics[id];
}
public bool IsValid()
{
return status != 0;
}
public bool IsDebug()
{
return status == 2;
}
}
}