Exemplo n.º 1
0
 public Destructor(string className, Modifier m, IRegion region, IRegion bodyRegion)
 {
     FullyQualifiedName = "~" + className;
     this.region     = region;
     this.bodyRegion = bodyRegion;
     modifiers = (ModifierEnum)m;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Column"/> class.
 /// </summary>
 /// <param name="table">The parent table.</param>
 /// <param name="name">The column's name.</param>
 /// <param name="modifier">The modifier.</param>
 internal Column(Table table, string name, Modifier modifier)
 {
     Table = table;
     IsNullable = true;
     Name = name;
     Modifier = modifier;
 }
Exemplo n.º 3
0
 public void Check(Modifier allowed)
 {
     Modifier wrong = cur & (allowed ^ Modifier.All);
     if (wrong != Modifier.None) {
         parser.Error("modifier(s) " + wrong + " not allowed here");
     }
 }
Exemplo n.º 4
0
        public virtual void Initialize(Modifier modifier, Engine game)
        {
            Game = game;
            Modifier = modifier;

            Initialize();
        }
Exemplo n.º 5
0
 public bool ApplyModifiers(Stack stack, Modifier mod)
 {
     //This is used to perform the mathematical modifiers.
     int firstValue = stack.Pop();
     Program.form.listBox1.Items.Add("FirstValue is removed from stack.");
     int secondValue = stack.Pop();
     Program.form.listBox1.Items.Add("SecondValue is removed from stack.");
     if (mod == Modifier.Add){
         Push(firstValue+secondValue);
         Program.form.listBox1.Items.Add("Pushed " + (firstValue + secondValue) + " to stack.");
     }
     else if (mod == Modifier.Divide){
         if(secondValue == 0){
             Program.form.listBox1.Items.Add("Can't devide by zero.");
             return false;
         }
         Push(firstValue/secondValue);
         Program.form.listBox1.Items.Add("Pushed " + (firstValue / secondValue) + " to stack.");
     }
     else if (mod == Modifier.Multiply){
         Push(firstValue*secondValue);
         Program.form.listBox1.Items.Add("Pushed " + (firstValue * secondValue) + " to stack.");
     }
     else if (mod == Modifier.Subtract){
         Push(firstValue-secondValue);
         Program.form.listBox1.Items.Add("Pushed " + (firstValue - secondValue) + " to stack.");
     }
     else{
         Program.form.listBox1.Items.Add("Unknown modifier: " + mod); //Just to be sure.
         return false;
     }
     return true;
 }
Exemplo n.º 6
0
        /// <summary>
        /// MouseMove method for Guideline
        /// </summary>
        /// <param name="X">mouse X position</param>
        /// <param name="Y"> mouse Y position</param>
        /// <param name="keys"> mouse and keyboard modifiers</param>
        /// <param name="ps">the InteractivePlotSurface2D</param>
        public override bool DoMouseMove(int X, int Y, Modifier keys, InteractivePlotSurface2D ps)
        {
            Rectangle plotArea = ps.PlotAreaBoundingBoxCache;

            if (drawPending) {
                overRuns += 1;
                return false;
            }

            // note previous guideline ready to erase it
            Rectangle prevExtent = lineExtent;

            // Only display guideline when mouse is within the plotArea
            if (plotArea.Contains(X,Y)) {
                int h = 1;
                int w = plotArea.Right - plotArea.Left + 1;
                lineExtent = new Rectangle (plotArea.X, Y, w, h);
                drawPending = true;
            }
            else {
                lineExtent = Rectangle.Empty;
            }
            ps.QueueDraw (prevExtent);
            ps.QueueDraw (lineExtent);
            return false;
        }
Exemplo n.º 7
0
 public void AddModifierObstacle(Modifier modifier, Unit unit)
 {
     if (Obstacle != null)
     {
         End();
     }
 }
Exemplo n.º 8
0
		public Constructor(Modifier m, IRegion region, IRegion bodyRegion)
		{
			FullyQualifiedName = "ctor";
			this.region     = region;
			this.bodyRegion = bodyRegion;
			modifiers = (ModifierEnum)m;
		}
Exemplo n.º 9
0
 public Class(CompilationUnit cu, ClassType t, Modifier m, IRegion region)
 {
     this.cu = cu;
     classType = t;
     this.region = region;
     modifiers = (ModifierEnum)m;
 }
 public IndexerDeclaration(TypeReference typeReference, ArrayList parameters, Modifier modifier, ArrayList attributes)
 {
     this.type = typeReference;
     this.modifier = modifier;
     this.parameters = parameters;
     this.attributes = attributes;
 }
Exemplo n.º 11
0
 /// <summary>
 /// MouseDown method for PlotDrag interaction
 /// </summary>
 /// <param name="X">mouse X position</param>
 /// <param name="Y"> mouse Y position</param>
 /// <param name="keys"> mouse and keyboard modifiers</param>
 /// <param name="ps">the InteractivePlotSurface2D</param>
 public override bool DoMouseDown(int X, int Y, Modifier keys, InteractivePlotSurface2D ps)
 {
     // Only start drag if mouse is inside plot area (excluding axes)
     Rectangle area = ps.PlotAreaBoundingBoxCache;
     if (area.Contains(X,Y)) {
         dragInitiated_ = true;
         lastPoint_ = new Point(X,Y);
         if (((keys & Modifier.Button1) != 0)) {		   // Drag
             if (horizontal_ || vertical_) {
                 ps.plotCursor = CursorType.Hand;
             }
             if (((keys & Modifier.Control) != 0)) {	   // Zoom
                 if (horizontal_)
                     ps.plotCursor = CursorType.LeftRight;
                 if (vertical_)
                     ps.plotCursor = CursorType.UpDown;
                 if (horizontal_ && vertical_)
                     ps.plotCursor = CursorType.Zoom;
             }
         }
         // evaluate focusPoint about which axis is expanded
         focusX = (double)(X - area.Left)/(double)area.Width;
         focusY = (double)(area.Bottom - Y)/(double)area.Height;
     }
     return false;
 }
 public PropertyDeclaration(string name, TypeReference typeReference, Modifier modifier, ArrayList attributes)
 {
     this.name = name;
     this.typeReference = typeReference;
     this.modifier = modifier;
     this.attributes = attributes;
 }
Exemplo n.º 13
0
 public Field(ReturnType type, string fullyQualifiedName, Modifier m, IRegion region)
 {
     this.returnType = type;
     this.FullyQualifiedName = fullyQualifiedName;
     this.region = region;
     modifiers = (ModifierEnum)m;
 }
        ArrayList parameters = new ArrayList(); // [ParameterDeclarationExpression]

        #endregion Fields

        #region Constructors

        public ConstructorDeclaration(string name, Modifier modifier, ArrayList parameters, ArrayList attributes)
        {
            this.name     = name;
            this.modifier = modifier;
            this.parameters = parameters;
            this.attributes = attributes;
        }
Exemplo n.º 15
0
        /// <summary>
        /// Mouse Scroll (wheel) method for AxisZoom interaction
        /// </summary>
        public override bool DoMouseScroll(int X, int Y, int direction, Modifier keys, InteractivePlotSurface2D ps)
        {
            double proportion = 0.1*sensitivity_;	// use initial zoom of 10%
            double focusX = 0.5, focusY = 0.5;		// default focus point

            // Zoom direction is +1 for Up/ZoomIn, or -1 for Down/ZoomOut
            proportion *= -direction;

            // delete previous focusPoint drawing - this is all a bit 'tentative'
            ps.QueueDraw (focusRect);

            Rectangle area = ps.PlotAreaBoundingBoxCache;
            if (area.Contains(X,Y)) {
                pF.X = X;
                pF.Y = Y;
                focusX = (double)(X - area.Left)/(double)area.Width;
                focusY = (double)(area.Bottom - Y)/(double)area.Height;
            }

            // Zoom in/out for all defined axes
            ps.CacheAxes();
            ps.ZoomXAxes (proportion,focusX);
            ps.ZoomYAxes (proportion,focusY);

            int x = pF.X-10;
            int y = pF.Y-10;

            focusRect = new Rectangle (x, y, 21, 21);
            // draw new focusRect
            ps.QueueDraw (focusRect);

            return (true);
        }
Exemplo n.º 16
0
	// Use this for initialization
	void Start () {
		gameControl = GameObject.Find("GameControl").GetComponent("GameControl") as GameControl;
		mod			= gameObject.GetComponent<Modifier>();
		boot_boom	= PlayerPrefs.GetInt("Boot_Boom");
		item_revive		= PlayerPrefs.GetInt("Revive");

		_fb = gameObject.GetComponent<GUIFB>();
	}
Exemplo n.º 17
0
 public Field(ReturnType type, string fullyQualifiedName, Modifier m, IRegion region)
 {
     this.returnType = type;
     this.FullyQualifiedName = fullyQualifiedName;
     this.region = region;
     modifiers = (ModifierEnum)m;
     //			Console.WriteLine("modifiers for field {0} are {1} were {2}", fullyQualifiedName, modifiers, m);
 }
Exemplo n.º 18
0
		public Property(string fullyQualifiedName, ReturnType type, Modifier m, IRegion region, IRegion bodyRegion)
		{
			this.FullyQualifiedName = fullyQualifiedName;
			returnType = type;
			this.region = region;
			this.bodyRegion = bodyRegion;
			modifiers = (ModifierEnum)m;
		}
Exemplo n.º 19
0
    private void AddScatterModifier(Modifier modifier)
    {
        ModifierEnumifier.WriteNewModifier(modifier, replacementIndex, 2); //2 should be the index for default modifiers

        ModifierEnumifier.GenerateFile();

        Close();
    }
Exemplo n.º 20
0
    private void AddBeamModifier(Modifier modifier)
    {
        ModifierEnumifier.WriteNewModifier(modifier, replacementIndex, 4); //4 should be the index for beam modifiers

        ModifierEnumifier.GenerateFile();

        Close();
    }
Exemplo n.º 21
0
 public void Add(Modifier m)
 {
     if (!this.HasModifier(m))
     {
         this.items[this.count] = m;
         this.count++;
     }
 }
Exemplo n.º 22
0
 public Indexer(ReturnType type, ParameterCollection parameters, Modifier m, IRegion region, IRegion bodyRegion)
 {
     returnType      = type;
     this.parameters = parameters;
     this.region     = region;
     this.bodyRegion = bodyRegion;
     modifiers = (ModifierEnum)m;
 }
Exemplo n.º 23
0
 public void Add(Modifier m)
 {
     if ((cur & m) == 0) {
         cur |= m;
     } else {
         parser.Error("modifier " + m + " already defined");
     }
 }
Exemplo n.º 24
0
 protected FieldDef(Namespace ns, string name, Modifier modifiers)
     : base(
         null,
         (ns is GlobalRootNamespace
              ? new MemberName(name)
              : new MemberName(ns.MemberName, Separators.DoubleColon, name)), modifiers)
 {
 }
Exemplo n.º 25
0
 public ClassName(Type ty)
     : this(ty.Namespace, Modifier.Public, ty.Name)
 {
     if (ty.IsPublic)
         this.modifier = Modifier.Public;
     else
         this.modifier = Modifier.Internal;
 }
Exemplo n.º 26
0
    private void AddProjectileModifier(Modifier modifier)
    {
        ModifierEnumifier.WriteNewModifier(modifier, replacementIndex, 1); //1 should be the index for Projectile modifiers

        ModifierEnumifier.GenerateFile();

        Close();
    }
 public MethodDeclaration(string name, Modifier modifier, TypeReference typeReference, ArrayList parameters, ArrayList attributes)
 {
     this.name = name;
     this.modifier = modifier;
     this.typeReference = typeReference;
     this.parameters = parameters;
     this.attributes = attributes;
 }
 public EventDeclaration(TypeReference typeReference, string name, Modifier modifier, ArrayList attributes)
 {
     this.typeReference = typeReference;
     this.name = name;
     this.variableDeclarators = null;
     this.modifier = modifier;
     this.attributes = attributes;
 }
Exemplo n.º 29
0
 public Method(string name, ReturnType type, Modifier m, IRegion region, IRegion bodyRegion)
 {
     FullyQualifiedName = name;
     returnType = type;
     this.region     = region;
     this.bodyRegion = bodyRegion;
     modifiers = (ModifierEnum)m;
 }
Exemplo n.º 30
0
    private void AddMineModifier(Modifier modifier)
    {
        ModifierEnumifier.WriteNewModifier(modifier, replacementIndex, 3); //0 should be the index for mine modifiers

        ModifierEnumifier.GenerateFile();

        Close();
    }