public void Action()
        {
            var    CV = UpCall.TD.Villages[VillageID];
            int    GID;
            var    Q = this;
            string mat_str, id, c;
            Match  m;
            string result;

            switch (ResearchType)
            {
            case TResearchType.Research:
                if (!CV.Upgrades[Aid].CanResearch)
                {
                    MarkDeleted  = true;
                    UpCall.Dirty = true;
                    UpCall.CallStatusUpdate(this, new Travian.StatusChanged()
                    {
                        ChangedData = Travian.ChangedType.Queue, VillageID = VillageID
                    });
                    return;
                }
                GID    = 22;
                result = UpCall.PageQuery(VillageID, "build.php?gid=" + GID.ToString());
                if (result == null)
                {
                    return;
                }
                mat_str = "'build.php\\?id=(\\d+)&a=" + Aid.ToString() + "&c=([^']*?)'";
                m       = Regex.Match(result, mat_str);
                if (!m.Success)
                {
                    return;
                }
                id     = m.Groups[1].Value;
                c      = m.Groups[2].Value;
                result = UpCall.PageQuery(VillageID, "build.php?id=" + id + "&a=" + Aid.ToString() + "&c=" + c);
                break;

            case TResearchType.UpTroopLevel:
                if (TargetLevel != 0 && CV.Upgrades[Aid].troop_lvl >= TargetLevel || CV.Upgrades[Aid].troop_lvl >= CV.SmithyLevel)
                {
                    MarkDeleted  = true;
                    UpCall.Dirty = true;
                    UpCall.CallStatusUpdate(this, new Travian.StatusChanged()
                    {
                        ChangedData = Travian.ChangedType.Queue, VillageID = VillageID
                    });
                    return;
                }
                GID    = 13;
                result = UpCall.PageQuery(VillageID, "build.php?gid=" + GID.ToString());
                if (result == null)
                {
                    return;
                }
                mat_str = "'build.php\\?id=(\\d+)&a=" + Aid.ToString() + "&c=([^']*?)'";
                m       = Regex.Match(result, mat_str, RegexOptions.Singleline);
                if (!m.Success)
                {
                    return;
                }
                id     = m.Groups[1].Value;
                c      = m.Groups[2].Value;
                result = UpCall.PageQuery(VillageID, "build.php?id=" + id + "&a=" + Aid.ToString() + "&c=" + c);
                break;

            default:
                return;
            }
            UpCall.BuildCount();

            if (TargetLevel == 0 || ResearchType == TResearchType.Research)
            {
                MarkDeleted  = true;
                UpCall.Dirty = true;
                UpCall.CallStatusUpdate(this, new Travian.StatusChanged()
                {
                    ChangedData = Travian.ChangedType.Queue, VillageID = VillageID
                });
            }
            else if (ResearchType == TResearchType.UpTroopLevel)
            {
                if (CV.Upgrades[Aid].troop_lvl >= TargetLevel || CV.Upgrades[Aid].troop_lvl >= CV.SmithyLevel)
                {
                    MarkDeleted  = true;
                    UpCall.Dirty = true;
                    UpCall.CallStatusUpdate(this, new Travian.StatusChanged()
                    {
                        ChangedData = Travian.ChangedType.Queue, VillageID = VillageID
                    });
                }
            }

            UpCall.CallStatusUpdate(this, new Travian.StatusChanged()
            {
                ChangedData = Travian.ChangedType.Research, VillageID = VillageID
            });
        }