void Start() { lineFactory = GameObject.FindGameObjectWithTag("LineFactory").GetComponent <LineFactory>(); nodePrefab = Resources.Load <Transform>("Node"); GenerateNodes(); GenerateNodeConnections(); }
void Start() { lineFactory = GameObject.FindGameObjectWithTag("LineFactory").GetComponent <LineFactory>(); drawnObjects = new Transform[300, 300, 10]; tileWidth = 1.73f; tileHeight = 1.49f; map = new Map(this.generatorSettings, this); DrawBackground(); DrawRoads(); DrawHouses(); DrawResources(); foreach (District district in map.districts) { Coordinates coordinates = district.tileLocations[0]; //TODO: See why this line sometimes errors when game started int x = coordinates.x; int y = coordinates.y; var go = Instantiate(Resources.Load <Transform>("prefabText"), new Vector3(x * tileWidth, y * tileHeight, 0), Quaternion.identity); go.SetPositionAndRotation(new Vector3(x * tileWidth, y * tileHeight, 0), Quaternion.identity); go.GetComponent <TextMesh>().text = district.districtName; go.GetComponent <MeshRenderer>().sortingOrder = 5; drawnObjects[x, y, 3] = go; } GameObject.FindGameObjectWithTag("_Manager").GetComponent <LocalPolitics>().GeneratePolitics(); }
private void toolStripButtonLine_Click(object sender, EventArgs e) { CurrentFactory = new LineShapeFactory(); Factory current = new LineFactory(pnlMain); CurrentDrawman = current.FactoryMethod(); }
public static GameObject CreateHighway(OsmWay highwayData, OsmBounds bounds, Transform parent) { Vector3[] linePoints = new Vector3[highwayData.Nodes.Count]; for (int i = 0; i < highwayData.Nodes.Count; i++) { linePoints[i] = OsmToUnityConverter.GetPointFromUnityPointVec3(highwayData.Nodes[i].Point, bounds); } HighwayTypeEnum type = OSMtoSharp.Enums.Helpers.EnumExtensions. GetTagKeyEnum <HighwayTypeEnum> (highwayData.Tags[TagKeyEnum.Highway]); float width = GetHighwayWidth(type); Color color = GetHighwayColor(type); GameObject result = LineFactory.CreateLine(linePoints, width, color, new Material(Shader.Find("Sprites/Default"))); if (highwayData.Tags.ContainsKey(TagKeyEnum.Name)) { result.name = highwayData.Tags[TagKeyEnum.Name]; CreateRoadNameLabel(linePoints, result.name, result.transform); } else { result.name = "<highway>"; } result.transform.parent = parent; return(result); }
public void HandleEvent() { lineFactory = new LineFactory(); Canvas.CurFigureFactory = lineFactory; MouseEventArgs eMouse = (MouseEventArgs)E; Canvas.PrevPoint = new System.Drawing.PointF(eMouse.X, eMouse.Y); }
public CursorPointsUseCase(ICursorPointsEntity cursorPointsEntity, IEnclosurePointsEntity enclosurePointsEntity, LineFactory lineFactory, EnclosureFactory enclosureFactory) { _cursorPointsEntity = cursorPointsEntity; _enclosurePointsEntity = enclosurePointsEntity; _lineFactory = lineFactory; _enclosureFactory = enclosureFactory; }
public async Task Should_UpdateStockProduct_When_MerchantProductExist(string no1, string no2) { topSoldProductServiceMock.GetOrderTopSoldProducts(LineFactory.CreateLines( LineFactory.CreateLine(no1), LineFactory.CreateLine(no2) )); var handler = new UpdateStockCommandHandler(topSoldProductServiceMock.Object, dataSourceMock.Object); await handler.Handle(new UpdateStockCommand(no2), CancellationToken.None); }
public static LineFactory CreateLineFactory() { GameObject newLinePool = new GameObject { name = "LinePool" }; LineFactory lineFactory = newLinePool.AddComponent <LineFactory>(); lineFactory.linePrefab = Resources.Load <GameObject>("Prefabs/line"); return(lineFactory); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
public Drawer(IInputReader inputReader, LineProperty lineProperty, GameObject linePrefab, Camera rayCamera, int canvasLayer) { lineFactory = new LineFactory(linePrefab); layerMask = canvasLayer; this.rayCamera = rayCamera; this.inputReader = inputReader; UpdateLineProperty(lineProperty); SubscribeInputEvents(); }
public void TestDrawLine() { Line line = LineFactory.GetLine(); line.FirstpointXCoordinate = 100; line.FirstpointYCoordinate = 200; line.SecondpointXCoordinate = 400; line.SecondpointYCoordinate = 300; ILineOperation lineOperation = LineOperationFactory.GetLineOperation(); lineOperation.Draw(line); }
public static List <Line> GetLinesFromString(string input) { var lastPoint = new Point(0, 0); var lines = new List <Line>(); foreach (var lineString in input.Split(',')) { var newLine = LineFactory.CreateLine(lastPoint, lineString); lines.Add(newLine); lastPoint = newLine.EndPoint; } return(lines); }
public void GetLexemeLine() { LineFactory LexemLineFactory = new LineFactory(); LexemLine line = LexemLineFactory.MakeLexemLine(0, 1); int i = 0; foreach (LexemView view in line.LexemViews) { Assert.IsInstanceOfType(typeof(Lexeme), view.Lexem); Assert.AreEqual(i * FieldSettings.PictureWidth, view.X); i++; } Assert.AreEqual(FieldSettings.ColumnsNumbers, line.LexemViews.Count); }
private void ApplineConfigs() { this.Closing += MainWindow_Closing; NotifyContext <SomeDataContext> notify = new NotifyContext <SomeDataContext>(); this.DataContext = new SomeDataContext(); notify.Connected += Notify_Connected; notify.Disconnected += Notify_Disconnected; notify.Timeout += Notify_Timeout; notify.Message += Notify_Message; notify.ContextChanges += Notify_ContextChanges; notify.Exception += Notify_Exception; line = LineFactory.Application <SomeDataContext>(notify, 3000, ApplicationClient.App.ARGS); }
void Start() { Instance = this; pooledLines = new Line[maxLines]; for (int i = 0; i < maxLines; i++) { var line = Instantiate(linePrefab); line.SetActive(false); line.transform.SetParent(transform); pooledLines[i] = line.GetComponent <Line> (); } }
public static void CreatePower(OsmNode towerData, OsmBounds bounds, Transform parent) { Vector3[] linePoints = new Vector3[2]; linePoints[0] = OsmToUnityConverter.GetPointFromUnityPointVec3(towerData.Point, bounds); linePoints[1] = linePoints[0]; linePoints[1].y = GetPowerTowerHeight(); float width = GetPowerTowerWidth(); Color color = GetPowerTowerColor(); GameObject result = LineFactory.CreateLine(linePoints, width, color, new Material(Shader.Find("Sprites/Default"))); result.name = "<powertower>"; result.transform.parent = parent; }
public async Task Should_FillProductsNames(string no1, string no2, string no3, string no4, string no5, string no6) { dataSourceMock.GetProductsAsyncMock(ProductFactory.CreateProducts(no1, no2, no3, no4, no5, no6)); topSoldProductServiceMock.GetOrderTopSoldProducts(LineFactory.CreateLines( LineFactory.CreateLine(no1), LineFactory.CreateLine(no2), LineFactory.CreateLine(no3), LineFactory.CreateLine(no4), LineFactory.CreateLine(no5) )); var handler = new GetTopSoldProductsQueryHandler(dataSourceMock.Object, topSoldProductServiceMock.Object); var products = await handler.Handle(new GetTopSoldProductsQuery(), CancellationToken.None); Assert.All(products, x => Assert.NotNull(x.Name)); }
public LineManager( LineRepository lineRepository, StopManager stopManager, RouteStopRepository routeStopRepository, DepartureRepository departureRepository, LineValidator lineValidator, LineCorrector lineCorrector, LineFactory lineFactory) { _lineRepository = lineRepository; _stopManager = stopManager; _routeStopRepository = routeStopRepository; _lineValidator = lineValidator; _departureRepository = departureRepository; _lineCorrector = lineCorrector; _lineFactory = lineFactory; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here factory = new LineFactory(graphics.GraphicsDevice); lines = new List <Base2DLine>(); lines.Add(factory.GetSimpleLine(new Vector2(100, 100), new Vector2(200, 200), Color.Red, "Label")); lines.Add(factory.GetThickLine(new Vector2(200, 200), new Vector2(300, 100), Color.Red, 5, "Label")); lines.Add(factory.GetBezierCurve(new Vector2(200, 300), new Vector2(100, 200), Color.Red, 5, "Label")); lines.Add(factory.GetBezierCurve(new Vector2(200, 300), new Vector2(300, 200), Color.Red, 5, "Label")); mouse = factory.GetBezierCurve( new Vector2(graphics.PreferredBackBufferWidth * 0.5f, graphics.PreferredBackBufferHeight * 0.5f), Vector2.Zero, Color.Gray, 5, "Label"); base.Initialize(); }
private void ApplineConfigs() { this.Closing += MainWindow_Closing; NotifyContext <SomeDataContext> notify = new NotifyContext <SomeDataContext>(); SomeDataContext context = new SomeDataContext() { FirstName = "Dzmitry", LastName = "Dym" }; this.DataContext = context; notify.Connected += Notify_Connected; notify.Disconnected += Notify_Disconnected; notify.Timeout += Notify_Timeout; notify.Message += Notify_Message; notify.ContextChanges += Notify_ContextChanges; notify.Exception += Notify_Exception; line = LineFactory.Launcher <SomeDataContext>(notify, @"..\..\..\Application\bin\Debug\Application.exe", 3000); }
public static void CreateRailway(OsmWay railway, OsmBounds bounds, Transform parent) { RailwayTypeEnum type = OSMtoSharp.Enums.Helpers.EnumExtensions. GetTagKeyEnum <RailwayTypeEnum> (railway.Tags[TagKeyEnum.Railway]); Vector3[] linePoints = new Vector3[railway.Nodes.Count]; for (int i = 0; i < railway.Nodes.Count; i++) { linePoints[i] = OsmToUnityConverter.GetPointFromUnityPointVec3(railway.Nodes[i].Point, bounds); } float width = GetHighwayWidth(type); Color color = GetHighwayColor(type); GameObject result = LineFactory.CreateLine(linePoints, width, color, new Material(Shader.Find("Sprites/Default"))); result.name = "<railway>"; result.transform.parent = parent; }
void Awake() { buttons = new Button[3]; for (int i = 0; i < 3; i++) { //Debug.Log("making button "+i); GameObject buttonCopy = Instantiate <GameObject> (buttonPrefab); buttonCopy.transform.SetParent(this.transform); buttons [i] = buttonCopy.GetComponent <Button> (); } noteQueues = new Queue[3]; for (int i = 0; i < 3; i++) { noteQueues[i] = new Queue(); } beatsTillFree = new int[] { 0, 0, 0 }; lineFactory = GetComponent <LineFactory> (); lineStarts = new Vector3[3]; }
static void Main(string[] args) { log4net.Config.XmlConfigurator.Configure(); int ChoiceOfShape = 0; do { Console.WriteLine("Enter Your Choice to Draw Shape"); Console.WriteLine("1.Line"); Console.WriteLine("2.Circle"); Console.WriteLine("3.Rectangle"); Console.WriteLine("4.Exit"); ChoiceOfShape = int.Parse(Console.ReadLine()); switch (ChoiceOfShape) { case 1: Console.WriteLine("1.Line"); Line line = LineFactory.GetLine(); Console.WriteLine("Enter X Co-ordinate of First point"); int XLineFirst = int.Parse(Console.ReadLine()); Console.WriteLine("Enter Y Co-ordinate of First point"); int YLineFirst = int.Parse(Console.ReadLine()); Console.WriteLine("Enter X Co-ordinate of Second point"); int XLineSecond = int.Parse(Console.ReadLine()); Console.WriteLine("Enter Y Co-ordinate of Second point"); int YLineSecond = int.Parse(Console.ReadLine()); line.FirstpointXCoordinate = XLineFirst; //100 line.FirstpointYCoordinate = YLineFirst; //200 line.SecondpointXCoordinate = XLineSecond; //400 line.SecondpointYCoordinate = YLineSecond; //300 ILineOperation lineOperation = LineOperationFactory.GetLineOperation(); //IShapeOperation lineOperation = ShapeOperationFactory.GetLineOperation(); lineOperation.Draw(line); log.InfoFormat("Line Created"); break; case 2: Console.WriteLine("2.Circle"); Circle circle = CircleFactory.GetCircle(); Console.WriteLine("Enter X & Y Co-ordinate of Centre point"); int XCircleFirst = int.Parse(Console.ReadLine()); int YCircleFirst = int.Parse(Console.ReadLine()); Console.WriteLine("Enter X & Y Equidistance Points of Radius"); int XCircleSecond = int.Parse(Console.ReadLine()); int YCircleSecond = int.Parse(Console.ReadLine()); circle.FirstpointXCoordinate = XCircleFirst; //10 circle.FirstpointYCoordinate = YCircleFirst; //10 circle.SecondpointXCoordinate = XCircleSecond; //50 circle.SecondpointYCoordinate = YCircleSecond; //50 ICircleOperation circleOperation = CircleOperationalFactory.GetCircleOperation(); circleOperation.Draw(circle); log.InfoFormat("Circle Created"); break; case 3: Console.WriteLine("3.Rectangle"); ERectangle rectangle = RectangleFactory.GetRectangle(); Console.WriteLine("Enter X & Y Co-ordinate of First point of Rectangle"); int XRectFirst = int.Parse(Console.ReadLine()); int YRectFirst = int.Parse(Console.ReadLine()); Console.WriteLine("Enter X & Y Co-ordinate of Second Point of Rectangle"); int XRectSecond = int.Parse(Console.ReadLine()); int YRectSecond = int.Parse(Console.ReadLine()); rectangle.FirstpointXCoordinate = XRectFirst; rectangle.FirstpointYCoordinate = YRectFirst; rectangle.SecondpointXCoordinate = XRectSecond; rectangle.SecondpointYCoordinate = YRectSecond; IRectangleOperation rectangleOperation = RectangleOperationFactory.GetRectangleOperation(); rectangleOperation.Draw(rectangle); log.InfoFormat("Rectangle Created"); break; case 4: Console.WriteLine("4.Exit"); Console.WriteLine("Welcome Again!!"); System.Environment.Exit(0); break; default: Console.WriteLine("Wrong Choice ! "); break; } } while (ChoiceOfShape != 3); }
// Start is called before the first frame update void Start() { GM = FindObjectOfType <manager>(); lineFactory = FindObjectOfType <LineFactory>(); }
public async Task Should_ReturnUniqueMerchantNumbers(string no1, string no2, string no3, string no4) { dataSourceMock.GetInProgressOrdersAsyncMock(OrderFactory.CreateOrders( OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no1, 3)), OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no2, 3), LineFactory.CreateLine(no3, 4)), OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no1, 10)), OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no4, 5), LineFactory.CreateLine(no3, 8))) ); var topSoldProductService = new TopSoldProductService(dataSourceMock.Object); var products = await topSoldProductService.GetOrderTopSoldProducts(); Assert.Equal(products.Select(x => x.MerchantProductNo), products.Select(x => x.MerchantProductNo).Distinct()); }
// Use this for initialization void Awake() { this.screenWidth = (float)Screen.width; this.screenHeight = (float)Screen.height; this.screenRatio = this.screenWidth / this.screenHeight; this.gameUnitsVertical = 2 * Camera.main.orthographicSize; this.gameUnitsHorizontal = this.gameUnitsVertical * this.screenRatio; this.screenMargin = 0.1f; this.gameUnitsVerticalMargin = this.gameUnitsVertical * this.screenMargin; this.gameUnitsHorizontalMargin = this.gameUnitsHorizontal * this.screenMargin; this.gameUnitsVerticalInActiveArea = (this.gameUnitsVertical / 2) - (this.gameUnitsVerticalMargin); this.gameUnitsHorizontalInActiveArea = (this.gameUnitsHorizontal / 2) - (this.gameUnitsHorizontalMargin); lf = new LineFactory(); pcf = new PastelColorFactory(); BezierCurves = new List <List <Vector2> > { new List <Vector2> { new Vector2(-3, -2), new Vector2(-5, 2), new Vector2(-2, 3), new Vector2(0, 1) }, new List <Vector2> { new Vector2(-5, 2), new Vector2(-3, -2), new Vector2(-2, 3), new Vector2(0, 1) }, new List <Vector2> { new Vector2(-7, -2), new Vector2(-2, 4), new Vector2(-2, 4), new Vector2(7, -2) }, new List <Vector2> { new Vector2(4, 3), new Vector2(-5, 3), new Vector2(-4, -1), new Vector2(4, -2) }, new List <Vector2> { new Vector2(-6, -2), new Vector2(-2, 3), new Vector2(-0, -3), new Vector2(7, 2) }, new List <Vector2> { new Vector2(-2, 3), new Vector2(-5, -2), new Vector2(5, -2), new Vector2(2, 3) }, new List <Vector2> { new Vector2(-2, 3), new Vector2(-2, -3), new Vector2(-1, -3), new Vector2(6, 2) }, new List <Vector2> { new Vector2(-7, 0), new Vector2(-2, 1), new Vector2(1, -2), new Vector2(5, 1) }, new List <Vector2> { new Vector2(-5, 2), new Vector2(-3, -3), new Vector2(0, 3), new Vector2(3, 2) }, new List <Vector2> { new Vector2(-5, -2), new Vector2(-2, -2), new Vector2(0, 2), new Vector2(5, 0) }, new List <Vector2> { new Vector2(-2, 3), new Vector2(1, 1), new Vector2(-2, -1), new Vector2(-1, -3) }, new List <Vector2> { new Vector2(-4, -1), new Vector2(-2, 3), new Vector2(5, -1), new Vector2(5, -1) }, }; shapeMap = new Dictionary <Shape, CreateFunc> { { Shape.HorizontalLine, CreateHorizontalLine }, { Shape.VerticalLine, CreateVerticalLine }, { Shape.DiagonalLine, CreateDiagonalLine }, { Shape.CurvedLine, CreateCurvedLine }, { Shape.Triangle, CreateTriangle }, { Shape.Circle, CreateCircle }, { Shape.Ellipse, CreateEllipse }, { Shape.Square, CreateSquare }, { Shape.Rectangle, CreateRectangle } }; }
void Awake() { lineFactory = GetComponent <LineFactory>(); }
public async Task Should_ReturnTopSoldProducts(string no1, string no2, string no3, string no4, string no5, string no6) { dataSourceMock.GetInProgressOrdersAsyncMock(OrderFactory.CreateOrders( OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no1, 1)), OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no2, 3), LineFactory.CreateLine(no3, 4)), OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no4, 10)), OrderFactory.CreateOrdersWithLines(LineFactory.CreateLine(no5, 5), LineFactory.CreateLine(no6, 8))) ); var topSoldProductService = new TopSoldProductService(dataSourceMock.Object); var products = await topSoldProductService.GetOrderTopSoldProducts(); Assert.Collection(products, x => Assert.Equal(no4, x.MerchantProductNo), x => Assert.Equal(no6, x.MerchantProductNo), x => Assert.Equal(no5, x.MerchantProductNo), x => Assert.Equal(no3, x.MerchantProductNo), x => Assert.Equal(no2, x.MerchantProductNo) ); }
void Awake() { factory = this.GetComponent <LineFactory>(); }
void Start() { lineFactory = FindObjectOfType <LineFactory>(); }
public void NewFigure() { FigureFactory fact; Random r = new Random(); Y = 0; X = 5; Id = r.Next(0, 7); //Id = 6; //тест if (Id == 0) { fact = new LineFactory(); } else if (Id == 1) { fact = new SquareFactory(); } else if (Id == 2) { fact = new PyramideFactory(); } else if (Id == 3) { fact = new LeftZFactory(); } else if (Id == 4) { fact = new RightZFactory(); } else if (Id == 5) { fact = new LeftLFactory(); } else if (Id == 6) { fact = new RightLFactory(); } else { Id = 0; fact = new LineFactory(); } f = fact.CreateFigure(); f.Create(); Copy(); }