Esempio n. 1
0
 public void PerformTool(clsAction Tool)
 {
     foreach (var point in ChangedPoints)
     {
         Tool.PosNum = point;
         Tool.ActionPerform();
     }
 }
Esempio n. 2
0
    private void SaveData(string IsDelete)
    {
        long lngID = 0;

        try
        {
            //Filling Class Properties with values
            if (hfIsUpdate.Value == "N")
            {
                lngID = objDB.GerMaxIDNumber("ActionList", "ActionId");
            }
            else
            {
                lngID = Convert.ToInt32(hfID.Value);
            }

            clsAction objAction = new clsAction(lngID.ToString(), txtAction.Text.Trim(), txtDescription.Text.Trim(), txtActionType.Text.Trim(),
                                                ddlActionNature.SelectedValue.ToString(), (chkIsActive.Checked == true ? "N" : "Y"), "N", Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()));

            objMasMgr.InsertAction(objAction, hfIsUpdate.Value, IsDelete);

            if (hfIsUpdate.Value == "N")
            {
                lblMsg.Text = "Record Saved Successfully";
            }
            else
            {
                lblMsg.Text = "Record Updated Successfully";
            }
            Common.EmptyTextBoxValues(this);
            this.EntryMode(false);
            this.OpenRecord();
        }
        catch (Exception ex)
        {
            lblMsg.Text = "";
            throw (ex);
        }
    }
Esempio n. 3
0
 public void PerformActionMapSectors(clsAction tool, sPosNum centre)
 {
     PerformAction(tool, centre, new XYInt(tool.Map.SectorCount.X - 1, tool.Map.SectorCount.Y - 1));
 }
Esempio n. 4
0
 public void PerformActionMapVertices(clsAction tool, sPosNum centre)
 {
     PerformAction(tool, centre, tool.Map.Terrain.TileSize);
 }
Esempio n. 5
0
 public void PerformActionMapTiles(clsAction tool, sPosNum centre)
 {
     PerformAction(tool, centre, new XYInt(tool.Map.Terrain.TileSize.X - 1, tool.Map.Terrain.TileSize.Y - 1));
 }
Esempio n. 6
0
        private void PerformAction(clsAction action, sPosNum posNum, XYInt lastValidNum)
        {
            var y = 0;

            if (action.Map == null)
            {
                Debugger.Break();
                return;
            }

            var centre = GetPosNum(posNum);

            action.Effect = 1.0D;
            for (y = MathUtil.ClampInt(Tiles.YMin + centre.Y, 0, lastValidNum.Y) - centre.Y;
                 y <= MathUtil.ClampInt(Tiles.YMax + centre.Y, 0, lastValidNum.Y) - centre.Y;
                 y++)
            {
                action.PosNum.Y = centre.Y + y;
                var xNum = y - Tiles.YMin;
                var x    = 0;
                for (x = MathUtil.ClampInt(Tiles.XMin[xNum] + centre.X, 0, lastValidNum.X) - centre.X;
                     x <= MathUtil.ClampInt(Convert.ToInt32(Tiles.XMax[xNum] + centre.X), 0, lastValidNum.X) - centre.X;
                     x++)
                {
                    action.PosNum.X = centre.X + x;
                    if (action.UseEffect)
                    {
                        if (Tiles.ResultRadius > 0.0D)
                        {
                            switch (shape)
                            {
                            case ShapeType.Circle:
                                if (alignment)
                                {
                                    action.Effect =
                                        Convert.ToDouble(1.0D -
                                                         (new XYDouble(action.PosNum.X, action.PosNum.Y) -
                                                          new XYDouble(centre.X - 0.5D, centre.Y - 0.5D)).GetMagnitude() /
                                                         (Tiles.ResultRadius + 0.5D));
                                }
                                else
                                {
                                    action.Effect = Convert.ToDouble(1.0D - (centre - action.PosNum).ToDoubles().GetMagnitude() / (Tiles.ResultRadius + 0.5D));
                                }
                                break;

                            case ShapeType.Square:
                                if (alignment)
                                {
                                    action.Effect = 1.0D -
                                                    Math.Max(Math.Abs(action.PosNum.X - (centre.X - 0.5D)), Math.Abs(action.PosNum.Y - (centre.Y - 0.5D))) /
                                                    (Tiles.ResultRadius + 0.5D);
                                }
                                else
                                {
                                    action.Effect = 1.0D -
                                                    Math.Max(Math.Abs(action.PosNum.X - centre.X), Math.Abs(action.PosNum.Y - centre.Y)) /
                                                    (Tiles.ResultRadius + 0.5D);
                                }
                                break;
                            }
                        }
                    }
                    action.ActionPerform();
                }
            }
        }
Esempio n. 7
0
            public void PerformTool(clsAction Tool)
            {
                clsXY_int Point = default(clsXY_int);

                foreach ( clsXY_int tempLoopVar_Point in ChangedPoints )
                {
                    Point = tempLoopVar_Point;
                    Tool.PosNum = Point.XY;
                    Tool.ActionPerform();
                }
            }
Esempio n. 8
0
 public void PerformActionMapSectors(clsAction Tool, sPosNum Centre)
 {
     PerformAction(Tool, Centre, new XYInt(Tool.Map.SectorCount.X - 1, Tool.Map.SectorCount.Y - 1));
 }
Esempio n. 9
0
 public void PerformActionMapVertices(clsAction Tool, sPosNum Centre)
 {
     PerformAction(Tool, Centre, Tool.Map.Terrain.TileSize);
 }
Esempio n. 10
0
 public void PerformActionMapTiles(clsAction Tool, sPosNum Centre)
 {
     PerformAction(Tool, Centre, new XYInt(Tool.Map.Terrain.TileSize.X - 1, Tool.Map.Terrain.TileSize.Y - 1));
 }
Esempio n. 11
0
        private void PerformAction(clsAction Action, sPosNum PosNum, XYInt LastValidNum)
        {
            int   XNum   = 0;
            int   X      = 0;
            int   Y      = 0;
            XYInt Centre = new XYInt(0, 0);

            if (Action.Map == null)
            {
                Debugger.Break();
                return;
            }

            Centre = GetPosNum(PosNum);

            Action.Effect = 1.0D;
            for (Y = MathUtil.Clamp_int(Tiles.YMin + Centre.Y, 0, LastValidNum.Y) - Centre.Y;
                 Y <= MathUtil.Clamp_int(Tiles.YMax + Centre.Y, 0, LastValidNum.Y) - Centre.Y;
                 Y++)
            {
                Action.PosNum.Y = Centre.Y + Y;
                XNum            = Y - Tiles.YMin;
                for (X = MathUtil.Clamp_int(Tiles.XMin[XNum] + Centre.X, 0, LastValidNum.X) - Centre.X;
                     X <= MathUtil.Clamp_int(Convert.ToInt32(Tiles.XMax[XNum] + Centre.X), 0, LastValidNum.X) - Centre.X;
                     X++)
                {
                    Action.PosNum.X = Centre.X + X;
                    if (Action.UseEffect)
                    {
                        if (Tiles.ResultRadius > 0.0D)
                        {
                            switch (_Shape)
                            {
                            case enumShape.Circle:
                                if (_Alignment)
                                {
                                    Action.Effect =
                                        Convert.ToDouble(1.0D -
                                                         (new XYDouble(Action.PosNum.X, Action.PosNum.Y) -
                                                          new XYDouble(Centre.X - 0.5D, Centre.Y - 0.5D)).GetMagnitude() /
                                                         (Tiles.ResultRadius + 0.5D));
                                }
                                else
                                {
                                    Action.Effect = Convert.ToDouble(1.0D - (Centre - Action.PosNum).ToDoubles().GetMagnitude() / (Tiles.ResultRadius + 0.5D));
                                }
                                break;

                            case enumShape.Square:
                                if (_Alignment)
                                {
                                    Action.Effect = 1.0D -
                                                    Math.Max(Math.Abs(Action.PosNum.X - (Centre.X - 0.5D)), Math.Abs(Action.PosNum.Y - (Centre.Y - 0.5D))) /
                                                    (Tiles.ResultRadius + 0.5D);
                                }
                                else
                                {
                                    Action.Effect = 1.0D -
                                                    Math.Max(Math.Abs(Action.PosNum.X - Centre.X), Math.Abs(Action.PosNum.Y - Centre.Y)) /
                                                    (Tiles.ResultRadius + 0.5D);
                                }
                                break;
                            }
                        }
                    }
                    Action.ActionPerform();
                }
            }
        }