protected override void Execute(CodeActivityContext context) { AndroidDriver <AndroidElement> driver; // Inherit driver from scope activity OR from input (if out of context) try { driver = context.DataContext.GetProperties()["Driver"].GetValue(context.DataContext) as AndroidDriver <AndroidElement>; } catch { driver = Driver.Get(context); } // Receive fields int startx = StartX.Get(context); int starty = StartY.Get(context); int endx = EndX.Get(context); int endy = EndY.Get(context); int delay = Delay.Get(context); // Apply delay Thread.Sleep(delay); // Tap on the element new TouchAction(driver).Press(startx, starty).Wait(300).MoveTo(endx, endy).Release().Perform(); }
public Vector3 GetStart(float frame) { return(new Vector3( StartX.GetFrameValue(frame), StartY.GetFrameValue(frame), StartZ.GetFrameValue(frame))); }
public override double GetValue(double x) { double startX = StartX.GetValue(x); double startY = StartY.GetValue(x); double endX = EndX.GetValue(x); double endY = EndY.GetValue(x); if (x < startX) { // This makes it "flatline": x = startX; } else if (x > endX) { // This makes it "flatline": x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } // Read there: double y = SourceModule.GetValue(x); if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Return y: return(y); }
public void SaveToClipboard(int minX) { // adjust startX and HomeX, without going outside of the screen int shiftedStartX = StartX - minX; if (shiftedStartX < 0) { shiftedStartX = 0; } int shiftedHomeX = HomeX - minX; if (shiftedHomeX < 0) { shiftedHomeX = 0; } // start the string with the declaration of the map string text = "\t{ // -------- LEVEL -----------" + GetEOL(); text += "\t\t" + shiftedStartX.ToString() + ", //StartX" + GetEOL(); text += "\t\t" + StartY.ToString() + ", //StartY" + GetEOL(); text += "\t\t" + shiftedHomeX.ToString() + ", //HomeX" + GetEOL(); text += "\t\t" + HomeY.ToString() + ", //HomeY" + GetEOL(); text += "\t\t" + m_TotalTimeIn10thSec.ToString() + ", //Time In Multiple Of 10 seconds" + GetEOL(); text += "\t\t" + m_SpawnLemCount.ToString() + ", //Available Lem Count in multiple of 5 (from 0 to 15 max!!)" + GetEOL(); text += "\t\t" + m_RequiredLemCount.ToString() + ", //RequiredLemCount in multiple of 5 (obviously less or equals than the previous number)" + GetEOL(); text += "\t\t" + MinDropSpeed.ToString() + ", //Min Drop Speed in rough seconds (more precisely in multiple of 27 frames) (from 0 to 15) (high value = slow)" + GetEOL(); text += "\t\t" + Walker.ToString() + ", //Nb of available Walker" + GetEOL(); text += "\t\t" + Blocker.ToString() + ", //Nb of available Blocker" + GetEOL(); text += "\t\t" + Bomber.ToString() + ", //Nb of available Bomber" + GetEOL(); text += "\t\t" + DiagDigger.ToString() + ", //Nb of available Diagonal Digger" + GetEOL(); text += "\t\t" + HorizDigger.ToString() + ", //Nb of available Horizontal Digger" + GetEOL(); text += "\t\t" + VertDigger.ToString() + ", //Nb of available Vertical Digger" + GetEOL(); text += "\t\t" + Stairer.ToString() + ", //Nb of available Stair Builder" + GetEOL(); text += "\t\t" + Climber.ToString() + ", //Nb of available Climber" + GetEOL(); text += "\t\t" + Parachuter.ToString() + ", //Nb of available Parachuter" + GetEOL(); text += "\t\t(const unsigned char *)" + m_LocaMapName + ", //SpriteLocalization" + GetEOL(); text += "\t\tsizeof(" + m_LocaMapName + "), //size of the Map in number of sprite columns" + GetEOL(); text += "\t\t(const unsigned int *)" + m_MapIdsName + " //SpriteIdList" + GetEOL(); text += "\t}," + GetEOL(); // copy the text to the clipboard Clipboard.SetText(text); }
public override UnityEngine.Color GetColour(double x, double y) { double startX = StartX.GetValue(x, y); double startY = StartY.GetValue(x, y); double endX = EndX.GetValue(x, y); double endY = EndY.GetValue(x, y); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Read there: return(SourceModule.GetColour(x, y)); }
public override double GetWrapped(double x, double y, int wrap) { double startX = StartX.GetWrapped(x, y, wrap); double startY = StartY.GetWrapped(x, y, wrap); double endX = EndX.GetWrapped(x, y, wrap); double endY = EndY.GetWrapped(x, y, wrap); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Read there: return(SourceModule.GetWrapped(x, y, wrap)); }
/// <summary> /// convert the datatable to an XML document /// </summary> /// <param name="oNode"></param> /// <param name="y"></param> private void BuildTree(XmlNode oNode, int y) { XmlNode childNode = null; //has children foreach (TreeData.TreeDataTableRow childRow in dtTree.Select( string.Format("parentNodeID='{0}'", oNode.Attributes["nodeID"].InnerText))) { //for each child node call this function again childNode = GetXMLNode(childRow.nodeID, childRow.nodeDescription, childRow.nodeNote); oNode.AppendChild(childNode); BuildTree(childNode, y + 1); } //build node data //after checking for nodes we can add the current node int StartX; int StartY; int[] ResultsArr = new int[] { GetXPosByOwnChildren(oNode), GetXPosByParentPreviousSibling(oNode), GetXPosByPreviousSibling(oNode), _Margin }; Array.Sort(ResultsArr); StartX = ResultsArr[3]; StartY = (y * (_BoxHeight + _VerticalSpace)) + _Margin; int width = _BoxWidth; int height = _BoxHeight; //update the coordinates of this box into the matrix, for later calculations oNode.Attributes["X"].InnerText = StartX.ToString(); oNode.Attributes["Y"].InnerText = StartY.ToString(); //update the image size if (imgWidth < (StartX + width + _Margin)) { imgWidth = StartX + width + _Margin; } if (imgHeight < (StartY + height + _Margin)) { imgHeight = StartY + height + _Margin; } }
/// <summary> /// Gets the path representing this element. /// </summary> public override VectorPath GetPath(SVGElement context, RenderContext renderer) { Css.RenderableData rd = context.RenderData; if (_Path == null) { _Path = new VectorPath(); float startX = StartX.GetDecimal(rd, ViewportAxis.X); float startY = StartY.GetDecimal(rd, ViewportAxis.Y); float endX = EndX.GetDecimal(rd, ViewportAxis.X); float endY = EndY.GetDecimal(rd, ViewportAxis.Y); _Path.MoveTo(startX, startY); _Path.LineTo(endX, endY); } return(_Path); }
public override double GetValue(double x, double y, double z) { double startX = StartX.GetValue(x, y, z); double startY = StartY.GetValue(x, y, z); double startZ = StartY.GetValue(x, y, z); double endX = EndX.GetValue(x, y, z); double endY = EndY.GetValue(x, y, z); double endZ = EndY.GetValue(x, y, z); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } if (z < startZ) { // This makes it "flatline": z = startZ; } else if (z > endZ) { // This makes it "flatline": z = endZ; } else { // Box z: z = (z - startZ) / (endZ - startZ); } // Read there: return(SourceModule.GetValue(x, y, z)); }
/// <summary> /// Generates a unique hashcode based on the properties /// of this object. /// </summary> /// <returns>Generated hashcode.</returns> public override int GetHashCode() { return(StartY.GetHashCode() | StartX.GetHashCode() | Height.GetHashCode() | Width.GetHashCode()); }