Exemplo n.º 1
0
        // just simple validation here
        private bool IsNodeValid(Nodes.NodeRow node)
        {
            if (!node.IsFlagNull() && node.Flag == "3")
            {
                if (node.IsEntityNull() || node.Entity == "1023")
                {
                    MessageBox.Show(this.ParentForm, "Node " + node.ID + " is a Flag node and must have an entity number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return false;
                }
            }

            // TODO: this will have to check the aiscript for node_connect X Y [true|false]
            //       if / when aiscripts are handled, we can add this back.
            /*
            if (
                (node.IsConnection1Null() || node.Connection1 == "-1")
                &&
                (node.IsConnection2Null() || node.Connection2 == "-1")
                &&
                (node.IsConnection3Null() || node.Connection3 == "-1")
                &&
                (node.IsConnection4Null() || node.Connection4 == "-1")
                )
            {
                MessageBox.Show(this.ParentForm, "Node " + node.ID + " has no connections.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }
            */

            return true;
        }
Exemplo n.º 2
0
 public void FromNodeRow(Nodes.NodeRow nodeRow)
 {
     if (!nodeRow.IsIDNull()) ID = Convert.ToInt32(nodeRow.ID);
     if (!nodeRow.IsEntityNull()) Entity = Convert.ToInt32(nodeRow.Entity);
     if (!nodeRow.IsRadiusNull()) Radius = Convert.ToInt32(nodeRow.Radius);
     if (!nodeRow.IsFlagNull()) Flags = Convert.ToInt32(nodeRow.Flag);
     if (!nodeRow.IsGroupNull()) Group = Convert.ToInt32(nodeRow.Group);
     if (!nodeRow.IsTeamNull()) Team = Convert.ToInt32(nodeRow.Team);
     if (!nodeRow.IsConnection1Null()) Connect1 = Convert.ToInt32(nodeRow.Connection1);
     if (!nodeRow.IsConnection2Null()) Connect2 = Convert.ToInt32(nodeRow.Connection2);
     if (!nodeRow.IsConnection3Null()) Connect3 = Convert.ToInt32(nodeRow.Connection3);
     if (!nodeRow.IsConnection4Null()) Connect4 = Convert.ToInt32(nodeRow.Connection4);
     if (!nodeRow.IsPositionXNull()) Position = Convert.ToInt32(nodeRow.PositionX);
     if (!nodeRow.IsPositionYNull()) Position = Convert.ToInt32(nodeRow.PositionY);
     if (!nodeRow.IsPositionZNull()) Position = Convert.ToInt32(nodeRow.PositionZ);
 }