Ejemplo n.º 1
0
        public void ComparisonTest(DnxSdk sdk)
        {
            var file1a = new JObject
            {
                ["info"] = "foo"
            };

            var file1b = new JObject
            {
                ["info"] = "bar1"
            };

            var project1 = new Dir
            {
                ["file1"] = file1a,
                ["file2"] = file1b
            };

            var file2a = new JObject
            {
                ["info"] = "foo"
            };

            var file2b = new JObject
            {
                ["info"] = "bar2"
            };

            var project2 = new Dir
            {
                ["file1"] = file2a,
                ["file2"] = file2b
            };

            var project3 = new Dir
            {
                ["file1"] = file2a,
                ["file2"] = new DirItem(Dir.EmptyFile, skipComparison: true)
            };

            var project4 = new Dir
            {
                ["subdir1"] = project1,
                ["subdir2"] = project1
            };

            var project5 = new Dir
            {
                ["subdir1"] = new DirItem(project2, skipComparison: true),
                ["subdir2"] = project2
            };

            DirAssert.Equal(project1, project2, compareContents: false);
            DirAssert.Equal(project1, project3, compareContents: false);
            DirAssert.Equal(project1, project3);
            DirAssert.Equal(project2, project3);
            //DirAssert.Equal(project4, project5); // this should fail, but only subdir2 should be different

            TestUtils.CleanUpTestDir<DnuPublishTests>(sdk);
        }
Ejemplo n.º 2
0
        /// <summary>Выполняет один шаг алгоритма поведения мыши.</summary>
        /// <returns>Направление следующего шага мыши.</returns>
        public override Dir NextStep()
        {
            // Находим все доступные направления куда может пойти мышь из текущей клетки
            var canGoDirs = Context.GetCanGoDirs();

            // Если нет направлений в которые можно идти, то мышь окружена стенами. А-а-а!!!
            if(canGoDirs.Count() == 0)
            {
                Context.Write("Некуда идти! Мышь окружена.", Color.Coral);
                return Dir.None;
            }

            if(_prevDir != Dir.None && _status != Status.Back && Context.GetStones() != 0 && _prevStones < 4)
            {
                _status = Status.Back;
                return _prevDir.Reverse();
            }

            var index = _rnd.Next(canGoDirs.Count());
            _prevDir = canGoDirs.ElementAt(index);
            var stones = Context.GetStones();
            if(stones < 4) ++stones;
            Context.PutStones(stones);
            _prevStones = stones;
            _status = Status.Forward;
            return _prevDir;
        }
Ejemplo n.º 3
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            Shape? shape = null,
            Length[] coords = null,
            string href = null,
            NoHref? nohref = null,
            Target target = null,
            string alt = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            char? accesskey = null,
            int? tabindex = null,
            string onfocus = null,
            string onblur = null
        )
        {
            Shape = shape;
            Coords = coords;
            Href = href;
            NoHref = nohref;
            Target = target;
            Alt = alt;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            AccessKey = accesskey;
            TabIndex = tabindex;
            OnFocus = onfocus;
            OnBlur = onblur;

            return this;
        }
Ejemplo n.º 4
0
 static IEnumerable<Package> CreatePackageList(
     string name,
     string path,
     IEnumerable<Package> packageListConfig)
 {
     var firstPackage = packageListConfig.First();
     var dir = new Dir(new DirectoryInfo(path), "");
     var remainder = dir.FileList().ToHashSet();
     foreach (var p in packageListConfig.Skip(1))
     {
         var fileList = dir.FileList(p.FileList);
         remainder.ExceptWith(fileList);
         yield return new Package(
             name:
                 name +
                 "_" +
                 p.Name.Select(n => n, () => string.Empty),
             package: p,
             fileList: fileList
         );
     }
     //
     remainder.UnionWith(dir.FileList(firstPackage.FileList));
     yield return new Package(
         name: name,
         package: firstPackage,
         fileList: remainder
     );
 }
Ejemplo n.º 5
0
        public void IfNoCorridor_ShouldSucceed_IfCorridorExists(Dir dir)
        {
            var cell = new MapCell();
            cell.Sides[dir] = Side.Empty;

            Assert.That(() => ThrowD.IfNoCorridor(cell, dir), Throws.Nothing);
        }
Ejemplo n.º 6
0
    public bool HasDir(CellLocation location, Dir dir)
    {
        CellType testType;

        if (dir == Dir.North)
            testType = caveCellGrid[location.x, location.y, location.z + 1];

        else if (dir == Dir.South)
            testType = caveCellGrid[location.x, location.y, location.z - 1];

        else if (dir == Dir.East)
            testType = caveCellGrid[location.x + 1, location.y, location.z];

        else if (dir == Dir.West)
            testType = caveCellGrid[location.x - 1, location.y, location.z];

        else if (dir == Dir.NorthEast)
            testType = caveCellGrid[location.x + 1, location.y, location.z + 1];

        else if (dir == Dir.NorthWest)
            testType = caveCellGrid[location.x - 1, location.y, location.z + 1];

        else if (dir == Dir.SouthEast)
            testType = caveCellGrid[location.x + 1, location.y, location.z - 1];

        else
            testType = caveCellGrid[location.x - 1, location.y, location.z - 1];

        if (testType == CellType.RockFloor) {

            return true;
        }

        return false;
    }
Ejemplo n.º 7
0
        public void MoveInDirection_MovesInCorrectDirection(int newWidth, int newHeight, Dir dir)
        {
            var point = new Point(5, 5);

            Assert.That(DirHelper.MoveInDir(point, dir),
                Is.EqualTo(new Point(newWidth, newHeight)));
        }
Ejemplo n.º 8
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string abbr = null,
            string axis = null,
            string headers = null,
            Scope? scope = null,
            int? rowspan = null,
            int? colspan = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            Align? align = null,
            char? @char = null,
            Length charoff = null,
            Valign? valign = null
        )
        {
            Abbr = abbr;
            Axis = axis;
            Headers = headers;
            Scope = scope;
            RowSpan = rowspan;
            ColSpan = colspan;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            Align = align;
            Char = @char;
            CharOff = charoff;
            Valign = valign;

            return this;
        }
Ejemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        if(Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android){//平台为IOS或者android时
            if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved){//输入触点大于0且移动时
                if(Input.GetTouch(0).deltaPosition.x < 0 - Mathf.Epsilon)_touchDir = Dir.Left;else _touchDir = Dir.Right;
            }
            // 当输入的触点数量大于0,且手指不动时
            if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Stationary){
                _touchDir = Dir.Stop;
            }
        }

        // 根据手势顺序或逆序换图
        if(_touchDir != Dir.Stop){
            if(_touchDir == Dir.Left){
                curTime += Time.deltaTime;
                if(curTime > duration){
                    curTime = 0;
                    index = index == 0 ? texAll.Length - 1 : index ;
                    plane.renderer.material.mainTexture = texAll[index--];
                }
            }else{
                curTime += Time.deltaTime;
                if(curTime > duration){
                    curTime = 0;
                    index = index == texAll.Length - 1 ? 0 : index ;
                    plane.renderer.material.mainTexture = texAll[index++];
                }
            }
        }
    }
Ejemplo n.º 10
0
    public IEnumerator Moveing(Transform startTr, Dir moveDir, float speed )
    {
        StartCoroutine(OffActive());
        gameObject.transform.position = startTr.position;
        thisTr = gameObject.transform;
        moveVector = startTr.position;


        while (true)
        {
            if (!gameObject.activeSelf)
                break;

            switch (moveDir)
            {
                case Dir.LEFT:
                    moveVector.x = thisTr.position.x + (-1 * speed * Time.deltaTime);
                    break;
                case Dir.RIGHT:
                    moveVector.x = thisTr.position.x + (speed * Time.deltaTime);
                    break;
                case Dir.UP:
                    moveVector.y = thisTr.position.y + (speed * Time.deltaTime);
                    break;
                case Dir.DOWN:
                    moveVector.y = thisTr.position.y + (-1 * speed * Time.deltaTime);
                    break;
            }

            thisTr.position = moveVector;

            yield return null;
        }
    }
Ejemplo n.º 11
0
    // 스카이 박스 스왑
    IEnumerator SwapSkyBox_Cor(Dir dir)
    {
        float time = 0;

        //  오른쪽으로 갈때
        while (Dir.RIGHT == dir && time < 1)
        {
            time += Time.smoothDeltaTime / durationTime;
            blend = Mathf.Lerp(blend, 1f, time);
            RenderSettings.skybox.SetFloat("_Blend", blend);

            if (blend >= 0.99)
            {
                break;
            }
            yield return null;
        }
        
        // 왼쪽으로 갈때
        while (Dir.LEFT == dir && time < 1)
        {
            time += Time.smoothDeltaTime / durationTime;
            blend = Mathf.Lerp(blend, 0f, time);
            RenderSettings.skybox.SetFloat("_Blend", blend);
            
            if (blend <= 0.01)
            {
                break;
            }
            yield return null;      
        }
    }
Ejemplo n.º 12
0
        public void changeRoom(DungeonModel model, Dir direction)
        {
            Dir oppositeDir = Positions.opposite(direction);
            currentRoom.exitAndDestroy(oppositeDir);

            currentRoom = makeCurrent(model.currentRoom);
            currentRoom.enterAndEnable(direction);
        }
Ejemplo n.º 13
0
 static bool GetTurnShapeInverse(Dir dir, bool postHalf)
 {
     if (dir == Dir.LEFT) {
         return postHalf ? true : false;
     } else {
         return postHalf ? false : true;
     }
 }
Ejemplo n.º 14
0
 static float GetTurnShapeRotate(Dir dir, bool postHalf)
 {
     if (dir == Dir.LEFT) {
         return postHalf ? 180 : 0;
     } else {
         return postHalf ? 90 : -90;
     }
 }
Ejemplo n.º 15
0
 public override void LoadFromXml(XmlElement el, XmlNamespaceManager nsmgr)
 {
     base.LoadFromXml(el, nsmgr);
     string pr = nsmgr.LookupPrefix(ProcessDefinition.WORKFLOW_NAMESPACE);
     if (pr != null && pr.Length > 0) pr += ":";
     VariableDir = (VariableDef.Dir)Enum.Parse(typeof(VariableDef.Dir), el.GetAttribute("dir"));
     DefaultValueExpr = SchemaUtil.GetXmlElementText(el, pr + "defaultValue", nsmgr);
 }
Ejemplo n.º 16
0
        public void IfNoCorridor_ShouldThrow_IfOutsideMap(Dir dir)
        {
            var cell = new MapCell();
            cell.Sides[dir] = Side.Wall;

            Assert.That(() => ThrowD.IfNoCorridor(cell, dir),
                Throws.InstanceOf<InvalidOperationException>());
        }
Ejemplo n.º 17
0
        public void changeRoom(Dir direction)
        {
            if (currentRoom != null)
                currentRoom.teardown();

            var newPos = currentRoom.pos + Positions.fromDir(direction);
            currentRoom = getRoomFromPos(newPos);
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Returns the complete path for the specified file in the specified MP directory.
 /// </summary>
 /// <param name="directory">A <see cref="Dir"/> value, indicating the directory where the file should be located</param>
 /// <param name="fileName">The name of the file for which to return the complete path.</param>
 /// <returns>A string containing the complete path.</returns>
 public static string GetFile(Dir directory, string fileName)
 {
   if (fileName.StartsWith(@"\") || fileName.StartsWith("/"))
   {
     throw new ArgumentException("The passed file name cannot start with a slash or backslash", "fileName");
   }
   return Path.Combine(Get(directory), fileName);
 }
Ejemplo n.º 19
0
 // 스카이 박스와 라이팅 변경 ( 외부 호출 )
 public void SwapSkyBoxAndLight(int skyboxNumber, Dir dir)
 {
     Debug.Log(111);
     RenderSettings.skybox = skies[skyboxNumber];
     StopAllCoroutines();
     StartCoroutine(SwapLight(skyboxNumber, dir));
     StartCoroutine(SwapSkyBox_Cor(dir));
 }
Ejemplo n.º 20
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string action = null,
            Method? method = null,
            MimeType enctype = null,
            Target target = null,
            string onsubmit = null,
            string onreset = null,
            MimeType[] accept = null,
            Charset[] acceptcharset = null,
            string id = null,
            string name = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null
        )
        {
            Action = action;
            Method = method;
            EncType = enctype;
            Target = target;
            OnSubmit = onsubmit;
            OnReset = onreset;
            Accept = accept;
            AcceptCharset = acceptcharset;
            Id = id;
            Name = name;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;

            return this;
        }
Ejemplo n.º 21
0
        static public Vector2f GetDir(Dir dir, float x = 1, float y = 1)
        {
            if (dir == Dir.Down) return new Vector2f(0, 1 * x);
            if (dir == Dir.Up) return new Vector2f(0, -1 * x);
            if (dir == Dir.Left) return new Vector2f(-1 * y, 0);
            if (dir == Dir.Right) return new Vector2f(1 * y, 0);

            return new Vector2f(0, 0);
        }
Ejemplo n.º 22
0
 ///<summary>Returns a basis with a zero angle along the given direction, and units that satisfy the given constraints.</summary>
 public static Basis FromDirectionAndUnits(Dir origin, double unitsPerTurn, bool isClockwisePositive)
 {
     if (unitsPerTurn <= 0) throw new ArgumentOutOfRangeException("unitsPerTurn", "unitsPerTurn <= 0");
     if (double.IsNaN(unitsPerTurn)) throw new ArgumentOutOfRangeException("unitsPerTurn", "unitsPerTurn is not a number");
     if (double.IsInfinity(unitsPerTurn)) throw new ArgumentOutOfRangeException("unitsPerTurn", "unitsPerTurn is infinite");
     var sign = isClockwisePositive ? -1 : +1;
     var factor = RadiansPerRotation / unitsPerTurn;
     return new Basis(origin.UnsignedNaturalAngle, sign * factor);
 }
Ejemplo n.º 23
0
	// Use this for initialization
	void Start () {
		//the init status of the enmeny
		mDir = _CurDir;
		mPose = CurPose;

		if (Parent != null) {
			Parent.Start();
		}
	}
Ejemplo n.º 24
0
 public static void Equal(Dir expected, Dir actual, bool compareContents = true)
 {
     var diff = actual.Diff(expected, compareContents);
     if (diff.NoDiff)
     {
         return;
     }
     throw new DirMismatchException(expected.LoadPath, actual.LoadPath, diff);
 }
Ejemplo n.º 25
0
        public void enterAndEnable(Dir direction)
        {
            Vector3 startOffscreen = Positions.fromDir(direction);
            startOffscreen.x *= ROOM_WIDTH;
            startOffscreen.y *= ROOM_HEIGHT;

            transform.localPosition = startOffscreen;
            StartCoroutine(moveRoom(Vector3.zero, eneableOnArrive));
        }
Ejemplo n.º 26
0
        public void exitAndDestroy(Dir direction)
        {
            roomeEnabled = false;
            Vector3 endPos = Positions.fromDir(direction);
            endPos.x *= ROOM_WIDTH;// TODO ROOM_HEIGHT somewhere else.. or dynamic?
            endPos.y *= ROOM_HEIGHT;// and width

            StartCoroutine(moveRoom(endPos, destroyOnArrive));
        }
Ejemplo n.º 27
0
	//change the direction of the character
	public void CheckDir(){
		if (gameObject == null) {
			return;
		} 
		needChangeStatus = false;
		if (mDir != _CurDir) {
			needChangeStatus = true;
			mDir = _CurDir;
		}
		if (mPose != CurPose) {
			needChangeStatus = true;
			mPose = CurPose;
		}
		Quaternion dir = gameObject.transform.localRotation;
		float curAngle = dir.eulerAngles.y % 360.0f;
		curAngle = curAngle < 0.0f ? curAngle + 360.0f : curAngle;
		//rotate the weapon
		if (rotateWeapon && CurPose != Pose.Die) {
			QuadTextureNgui tex = transform.GetChild(0).GetComponent<QuadTextureNgui>();
			if(curAngle >= 0.0f && curAngle <= 151f){
				int angle = ((int)(curAngle/10.0f) * 10);
				tex.mSpriteName = ""+angle;
				tex.mirrorX = false;
				tex.InitFace();
			} else if (curAngle > 151.0f && curAngle <= 301.0f){
				int angle = ((int)((301.0f - curAngle)/10.0f) * 10);
				tex.mSpriteName = ""+angle;
				tex.mirrorX = true;
				tex.InitFace();
			} else if(curAngle > 301.0f && curAngle <= 321.0f){
				int angle = ((int)((661.0f - curAngle)/10.0f) * 10);
				tex.mSpriteName = ""+angle;
				tex.mirrorX = true;
				tex.InitFace();
			}
		} else {
			//will not be used
			if((curAngle >= 0.0f && curAngle < 45.0f) || (curAngle > 315.0f && curAngle <= 360.0f)){
				_CurDir = Dir.RightUp;
			} 
			else if(curAngle >= 270.0f && curAngle <= 315.0f){
				_CurDir = Dir.LeftUp;
			}
			else if(curAngle >= 45.0f && curAngle < 90.0f){
				_CurDir = Dir.Right;
			}
			else if(curAngle >= 100.0f && curAngle < 270.0f){
				_CurDir = Dir.Left;
			}
			else if(curAngle >= 127.0f && curAngle < 180.0f){
				_CurDir = Dir.LeftDown;
			} 
			else if(curAngle >= 90.0f && curAngle < 127.0f){
				_CurDir = Dir.RightDown;
			}
		}
	}
Ejemplo n.º 28
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            Charset charset = null,
            string href = null,
            LangCode hreflang = null,
            Target target = null,
            MimeType type = null,
            LinkType? rel = null,
            LinkType? rev = null,
            Media? media = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null
        )
        {
            Charset = charset;
            Href = href;
            HrefLang = hreflang;
            Target = target;
            Type = type;
            Rel = rel;
            Rev = rev;
            Media = media;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;

            return this;
        }
Ejemplo n.º 29
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string name = null,
            int? size = null,
            Multiple? multiple = null,
            Disabled? disabled = null,
            int? tabindex = null,
            string onfocus = null,
            string onblur = null,
            string onchange = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null
        )
        {
            Name = name;
            Size = size;
            Multiple = multiple;
            Disabled = disabled;
            TabIndex = tabindex;
            OnFocus = onfocus;
            OnBlur = onblur;
            OnChange = onchange;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;

            return this;
        }
Ejemplo n.º 30
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string name = null,
            string value = null,
            ButtonType? type = null,
            Disabled? disabled = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            char? accesskey = null,
            int? tabindex = null,
            string onfocus = null,
            string onblur = null
        )
        {
            Name = name;
            Value = value;
            Type = type;
            Disabled = disabled;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            AccessKey = accesskey;
            TabIndex = tabindex;
            OnFocus = onfocus;
            OnBlur = onblur;

            return this;
        }
Ejemplo n.º 31
0
    static void Main(string[] args)
    {
        //Console.WriteLine("#1##1#");
        //Console.WriteLine("121121");
        //Console.WriteLine("#1##1#");

        string[] inputs = Console.ReadLine().Split(' ');
        width  = int.Parse(inputs[0]);
        height = int.Parse(inputs[1]);

        Console.Error.WriteLine(width + " " + height);

        grid = new int[height, width];

        for (int i = 0; i < height; i++)
        {
            var s = Console.ReadLine();
            for (int j = 0; j < width; j++)
            {
                if (s[j] == '0')
                {
                    grid[i, j] = 0;
                }
                else if (s[j] == '#')
                {
                    grid[i, j] = -1;
                }
                else
                {
                    grid[i, j] = 0;
                    starty     = i;
                    startx     = j;
                    direction  = (Dir)">v<^".IndexOf(s[j]);
                }
            }
            Console.Error.WriteLine(s);
        }

        var side = Console.ReadLine();

        Console.Error.WriteLine(side);
        sideLeft = side == "L";

        x        = startx;
        y        = starty;
        (dx, dy) = GetDeltas(direction);

        while (true)
        {
            if (CalcAdjacent(y, x) == 0)
            {
                break;
            }
            grid[y, x]++;
            TryTurn(sideLeft);

            while (CalcPassage(y + dy, x + dx) == 0)
            {
                direction = Turn(direction, !sideLeft);
                (dx, dy)  = GetDeltas(direction);
            }

            x += dx;
            y += dy;

            MobiusTransform(ref y, ref x);
            //)
            //{
            //    direction = (Dir)(((int)direction + 2) % 4);
            //}

            if (x == startx && y == starty)
            {
                break;
            }
        }

        for (int i = 0; i < height; i++)
        {
            for (int j = 0; j < width; j++)
            {
                Console.Write(grid[i, j] < 0 ? "#" : grid[i, j].ToString());
            }
            Console.WriteLine();
        }
    }
Ejemplo n.º 32
0
 public static string Path(Dir dir, string subPath, string filename)
 {
     return(Path(s_mySubDirectoryPaths[(int)dir], subPath, filename));
 }
Ejemplo n.º 33
0
 public void SetValidConnectors(int x, int y, bool[] vals, Dir facing = Dir.N)
 {
     grid[x, y].validConnectors = RotateVals(vals, Dir.N.RotSteps(facing));
 }
Ejemplo n.º 34
0
        public void Update(GameTime gameTime)
        {
            KeyboardState kState = Keyboard.GetState();
            float         dt     = (float)gameTime.ElapsedGameTime.TotalSeconds;


            if (kState.IsKeyDown(Keys.A) && !kStateOld.IsKeyDown(Keys.A)) // code for enemy attack
            {
                HurtPlayer(12.5f);                                        // hurt player half heart
                Debug.WriteLine($"Reduced health to: {health}");
            }


            isMoving = false;

            if (kState.IsKeyDown(Keys.Right) || kState.IsKeyDown(Keys.D))
            {
                direction = Dir.Right;
                isMoving  = true;
            }

            if (kState.IsKeyDown(Keys.Left) || kState.IsKeyDown(Keys.A))
            {
                direction = Dir.Left;
                isMoving  = true;
            }

            if (kState.IsKeyDown(Keys.Up) || kState.IsKeyDown(Keys.W))
            {
                direction = Dir.Up;
                isMoving  = true;
            }

            if (kState.IsKeyDown(Keys.Down) || kState.IsKeyDown(Keys.S))
            {
                direction = Dir.Down;
                isMoving  = true;
            }

            if (isMoving) // check this if player stops moving
            {
                switch (direction)
                {
                case Dir.Right:
                    if (position.X < 1240)
                    {
                        position.X += speed * dt;
                    }
                    break;

                case Dir.Left:
                    if (position.X > 100)     //this
                    {
                        position.X -= speed * dt;
                    }
                    break;

                case Dir.Down:
                    if (position.Y < 900)
                    {
                        position.Y += speed * dt;
                    }
                    break;

                case Dir.Up:
                    if (position.Y > 100)     // this
                    {
                        position.Y -= speed * dt;
                    }
                    break;
                }
            }

            switch (direction)
            {
            case Dir.Left:
                anim = animations[0];
                break;

            case Dir.Right:
                anim = animations[1];
                break;

            case Dir.Down:
                anim = animations[2];
                break;

            case Dir.Up:
                anim = animations[3];
                break;
            }



            anim.Position = new Vector2(position.X - 50, position.Y - 50);

            if (kState.IsKeyDown(Keys.Space))
            {
                anim.setFrame(0);
            }
            else if (isMoving)
            {
                anim.Update(gameTime);
            }
            else
            {
                anim.setFrame(1);
            }

            if (kState.IsKeyDown(Keys.Space) && kStateOld.IsKeyUp(Keys.Space))
            {
                Arrow.arrows.Add(new Arrow(position, direction));
            }

            kStateOld = kState;
        }
Ejemplo n.º 35
0
 public static string GetDirectoryPath(Dir dir)
 {
     return(Path(dir, null, null));
 }
Ejemplo n.º 36
0
    public Vector3 FindTopLeftVertexInSubMesh(Vector3 firstVertex, Vector3[] vertices)
    {
        Dir quadrant = FindVertexQuadrant(firstVertex, Input.mousePosition);

        return(FindTopLeftVertex(firstVertex, quadrant, m.SubDivide.XSubStep, m.SubDivide.ZSubStep, vertices));
    }
Ejemplo n.º 37
0
 public void SetDirectory(Dir dir)
 {
     Directory  = dir;
     FolderName = dir.Name;
     UpdateText();
 }
Ejemplo n.º 38
0
 public Connection(JToken j)
 {
     Direction = j[nameof(Direction)].EnumValue <Dir>();
     Map       = j[nameof(Map)].Value <string>();
     Offset    = j[nameof(Offset)].Value <int>();
 }
Ejemplo n.º 39
0
        private void LoadingDiskInfo()
        {
            Dir disk = new Dir();

            SocketManager.Send(BufferFormatV2.FormatFCA(disk, Deflate.Compress));
        }
Ejemplo n.º 40
0
        private static string ReceberDiretoria()
        {
            Console.WriteLine("+----------------------------------------------------------+");
            Console.WriteLine("|               Ler Directoria                             |");
            Console.WriteLine("+----------------------------------------------------------+");

            string mainPath     = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            string sql          = string.Empty;
            string option       = string.Empty;
            string relativePath = string.Empty;

            do
            {
                Console.WriteLine("Deseja criar uma pasta na raiz do programa sim(S) não(N)");
                option = Console.ReadLine().ToLower();

                if (option.Equals("s"))
                {
                    Console.WriteLine("Qual será o nome da pasta que ira conter os ficheiros a verificar?");
                    relativePath = Console.ReadLine();

                    while (Directory.Exists(relativePath))
                    {
                        Console.WriteLine("Já existe uma pasta com esse nome, por favor dê outro nome!");
                        relativePath = Console.ReadLine();
                    }

                    Console.WriteLine("A sua pasta foi criada em: ");
                    Console.WriteLine(mainPath + "\\" + relativePath);

                    // Adicionar esta directoria à base de dados
                    Dir dir = new Dir(mainPath + "\\" + relativePath, DataBaseFunctions.userLog);

                    if (AjudanteParaBD.InsertDirectory(dir) == -1)
                    {
                        Console.WriteLine("Erro ao criar a diretoria");
                        return(string.Empty);
                    }

                    Directory.CreateDirectory(relativePath);
                    return(mainPath + "\\" + relativePath);
                }

                else if (option.Equals("n"))
                {
                    Console.WriteLine("Introduza o caminho absoluto da diretoria que pretende verificar.");
                    Console.WriteLine("Ex.: C:/Caminho/Completo/Ate/A/Diretoria");
                    Console.Write("Introduzido:");

                    mainPath = Console.ReadLine();

                    while (!Directory.Exists(mainPath))
                    {
                        Console.WriteLine("O caminho introduzido não existe na sua maquina");
                        Console.WriteLine("Introduza o caminho absoluto da pasta que você deseja verificar");
                        Console.Write("Introduzido:");
                        mainPath = Console.ReadLine();
                    }

                    // Adicionar esta directoria à base de dados
                    Dir dir = new Dir(mainPath, DataBaseFunctions.userLog);

                    if (AjudanteParaBD.InsertDirectory(dir) == -1)
                    {
                        Console.WriteLine("Erro ao adicionar a diretoria na base de dados.");
                        return(string.Empty);
                    }

                    return(mainPath);
                }
            } while (true);
        }
Ejemplo n.º 41
0
        private static void Main()
        {
            const bool enableVac = false;

            bool FileFilter(string file)
            {
                var excludedFiles = new[]
                {
                    ".test.dll",
                    ".pdb",
                    "Micser.App.exe",
                    "Micser.Engine.exe",
                    "CodeAnalysisLog.xml",
                    "lastcodeanalysissucceeded",
                    "ManualStart.ps1"
                };

                return(!excludedFiles.Any(x => file.EndsWith(x, StringComparison.InvariantCultureIgnoreCase)));
            }

            var project = new Project("Micser")
            {
                GUID         = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b"),
                MajorUpgrade = MajorUpgrade.Default,
                UpgradeCode  = new Guid("10C43476-AAF1-46E2-9EC8-E87DD16F9119"),
            };

#if DEBUG
            project.SourceBaseDir = @"..\..\bin\Debug\";
#else
            project.SourceBaseDir = @"..\..\bin\Release\";

            project.DigitalSignature = new DigitalSignature
            {
                PfxFilePath = @"..\..\crt\Certificate.pfx",
                Description = "Micser",
                TimeUrl     = new Uri("http://timestamp.verisign.com/scripts/timstamp.dll")
            };
#endif

            project.Package.Attributes.Add("Manufacturer", "Lucas Loreggia");
            project.Package.Attributes.Add("Description", "Micser Installer");

            var appFile     = System.IO.Path.GetFullPath(System.IO.Path.Combine(project.SourceBaseDir, "App", "Micser.App.dll"));
            var appAssembly = System.Reflection.Assembly.LoadFrom(appFile);
            project.Version = appAssembly.GetName().Version;

            var coreFeature = new Feature("Micser", "Installs Micser core components.", true, false)
            {
                Id         = new Id("CoreFeature"),
                Attributes =
                {
                    { "AllowAdvertise", "no"           },
                    { "InstallDefault", "followParent" }
                }
            };

            project.DefaultFeature.AllowChange = false;
            project.DefaultFeature.Attributes.Add("AllowAdvertise", "no");
            project.DefaultFeature.Attributes.Add("InstallDefault", "local");
            project.DefaultFeature.Display = FeatureDisplay.expand;
            project.DefaultFeature.Children.Add(coreFeature);

            var appId = new Id("MicserAppExe");

            var programFilesDir = new Dir(coreFeature, @"%ProgramFiles%\Micser",
                                          new Files(coreFeature, @"App\*.*", FileFilter),
                                          new File(appId, coreFeature, @"App\Micser.App.exe"),
                                          new File(new Id("MicserEngineExe"), coreFeature, @"App\Micser.Engine.exe")
            {
                ServiceInstaller = new ServiceInstaller("Micser.Engine")
                {
                    StartOn                 = SvcEvent.Install_Wait,
                    StopOn                  = SvcEvent.InstallUninstall_Wait,
                    RemoveOn                = SvcEvent.Uninstall_Wait,
                    Type                    = SvcType.ownProcess,
                    Account                 = "LocalSystem",
                    Description             = "Micser Audio Engine Service",
                    DisplayName             = "Micser Engine",
                    Start                   = SvcStartType.auto,
                    DelayedAutoStart        = false,
                    Vital                   = true,
                    Interactive             = false,
                    FirstFailureActionType  = FailureActionType.restart,
                    SecondFailureActionType = FailureActionType.restart,
                    ThirdFailureActionType  = FailureActionType.restart
                }
            }
                                          );

            var programMenuDir = new Dir(coreFeature, @"%ProgramMenu%\Micser",
                                         new ExeFileShortcut(coreFeature, "Micser", @"[INSTALLDIR]\Micser.App.exe", ""),
                                         new ExeFileShortcut(coreFeature, "Uninstall Micser", "[SystemFolder]msiexec.exe", "/x [ProductCode]")
                                         );

#if X64
            project.Platform = Platform.x64;
#else
            project.Platform = Platform.x86;
#endif

            var launchAppAction = new Id("LaunchApp");

            var actions = new List <Action>();

            if (enableVac)
            {
                var vacFeature = new Feature("Virtual Audio Cable", "Installs the Micser Virtual Audio Cable driver.", true, true)
                {
                    Id         = new Id("VacFeature"),
                    Attributes =
                    {
                        { "AllowAdvertise", "no"           },
                        { "InstallDefault", "followParent" }
                    }
                };
                project.DefaultFeature.Children.Add(vacFeature);

                programFilesDir.Dirs[0].AddDir(new Dir(vacFeature, @"Driver",
                                                       new Files(vacFeature, @"Driver\Micser.Vac.Package\*.*")
                                                       ));

                var vacFeatureCondition = Condition.Create("&VacFeature = 3");

                actions.Add(new ManagedAction(
                                DriverActions.InstallDriver,
                                typeof(DriverActions).Assembly.Location,
                                Return.check,
                                When.Before,
                                Step.InstallFinalize,
                                Condition.NOT_BeingRemoved & vacFeatureCondition)
                {
                    Rollback       = nameof(DriverActions.UninstallDriver),
                    Impersonate    = false,
                    Execute        = Execute.deferred,
                    UsesProperties = ""
                });
                actions.Add(new ManagedAction(
                                DriverActions.UninstallDriver,
                                typeof(DriverActions).Assembly.Location,
                                Return.check,
                                When.After,
                                Step.InstallInitialize,
                                Condition.BeingUninstalled & vacFeatureCondition | Condition.Create("&VacFeature=2"))
                {
                    Rollback       = nameof(DriverActions.InstallDriver),
                    Impersonate    = false,
                    Execute        = Execute.deferred,
                    UsesProperties = ""
                });
            }

            actions.Add(new InstalledFileAction(launchAppAction, appId, "")
            {
                Impersonate = true,
                Sequence    = Sequence.NotInSequence
            });

            project.Dirs    = new[] { programFilesDir, programMenuDir };
            project.Actions = actions.ToArray();

            project.UI       = WUI.WixUI_Common;
            project.CustomUI = new CommomDialogsUI()
                               .On(NativeDialogs.WelcomeDlg, Buttons.Next, new ShowDialog(NativeDialogs.InstallDirDlg))
                               .On(NativeDialogs.InstallDirDlg, Buttons.Back, new ShowDialog(NativeDialogs.WelcomeDlg))
                               .On(NativeDialogs.MaintenanceTypeDlg, "ChangeButton", new ShowDialog(NativeDialogs.CustomizeDlg))
                               .On(NativeDialogs.CustomizeDlg, Buttons.Back, new ShowDialog(NativeDialogs.MaintenanceTypeDlg, Condition.Installed))
                               .On(NativeDialogs.ExitDialog, Buttons.Finish, new ExecuteCustomAction(launchAppAction, new Condition("WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1") & Condition.NOT_Installed));
            project.CustomUI.Properties.Remove("ARPNOMODIFY");

            project.AddProperty(new Property("WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT", "Launch Micser"));
            project.AddProperty(new Property("WIXUI_EXITDIALOGOPTIONALCHECKBOX", "1"));

            project.Include(WixExtension.UI);
            project.Include(WixExtension.NetFx);

            project.BuildMsi($"Installer\\Micser-{project.Version}-{project.Platform}.msi");
        }
Ejemplo n.º 42
0
    public Vector2 GetTextureCoord(ID id, Dir dir)  // updated 20th nov 2018
    {
        switch (id)
        {
        case ID.ERRORFALLBACK: return(ErrorFallback);

        case ID.AIR: return(Air);

        case ID.DESTROYSTAGE1: return(DestroyStage1);

        case ID.DESTROYSTAGE2: return(DestroyStage2);

        case ID.DESTROYSTAGE3: return(DestroyStage3);

        case ID.DESTROYSTAGE4: return(DestroyStage4);

        case ID.DESTROYSTAGE5: return(DestroyStage5);

        case ID.DESTROYSTAGE6: return(DestroyStage6);

        case ID.DESTROYSTAGE7: return(DestroyStage7);

        case ID.DESTROYSTAGE8: return(DestroyStage8);

        case ID.DESTROYSTAGE9: return(DestroyStage9);

        case ID.DESTROYSTAGE10: return(DestroyStage10);

        case ID.BEDROCK: return(Bedrock);

        case ID.BASALT: return(Basalt);

        case ID.GRANITE: return(Granite);

        case ID.GABBRO: return(Gabbro);

        case ID.OBSIDIAN: return(Obsidian);

        case ID.COAL: return(Coal);

        case ID.CLAY: return(Clay);

        case ID.SLATE: return(Slate);

        case ID.GRAVEL: return(Gravel);

        case ID.SAND: return(Sand);

        case ID.SANDSTONE: return(Sandstone);

        case ID.QUARTZITE: return(Quartzite);

        case ID.LIMESTONE: return(Limestone);

        case ID.MARBLE: return(Marble);

        case ID.MUD: return(Mud);

        case ID.MUDSTONE: return(Mudstone);

        case ID.GNEISS: return(Gneiss);

        case ID.SHALE: return(Shale);

        case ID.GRASS:
            if (dir == Dir.Up)
            {
                return(Grass_Top);
            }
            else if (dir == Dir.Down)
            {
                return(Mud);
            }
            else
            {
                return(Grass_Side);
            }

        case ID.HALITE: return(Halite);

        // Atlas row Y1
        case ID.LAVA_STILL: return(Lava_Still);

        case ID.LAVA_FLOWING: return(Lava_Flowing);

        case ID.WATER_STILL: return(Water_Still);

        case ID.WATER_FLOWING: return(Water_Flowing);

        case ID.NITRE: return(Nitre);

        case ID.GYPSUM: return(Gypsum);

        case ID.ANDESITE: return(Andesite);

        case ID.RYOLITE: return(Ryolite);

        case ID.DIORITE: return(Diorite);

        case ID.PERIDOTITE: return(Peridotite);

        case ID.PUMICE: return(Pumice);

        case ID.CHALK: return(Chalk);

        case ID.SILTSTONE: return(Siltstone);

        case ID.CLAYSTONE: return(Claystone);

        case ID.SCHIST: return(Schist);

        // several spaces available here on atlas



        case ID.SPERRYLITE: return(Sperrylite);

        case ID.URANINITE: return(Uraninite);

        case ID.BERYL: return(Beryl);

        case ID.CASSITERITE: return(Cassiterite);

        case ID.COBALTITE: return(Cobaltite);

        case ID.MOLYBDENITE: return(Molybdenite);

        case ID.MILLERITE: return(Millerite);

        case ID.POLLUCITE: return(Pollucite);

        case ID.PENTLANDITE: return(Pentlandite);

        case ID.PYRITE: return(Pyrite);

        // Atlas row Y2
        case ID.BAUXITE: return(Bauxite);

        case ID.CHALCOCITE: return(Chalcocite);

        case ID.GOLD: return(Gold);

        case ID.HEMATITE: return(Hematite);

        case ID.ACANTHITE: return(Acanthite);

        case ID.CHROMITE: return(Chromite);

        case ID.CINNABAR: return(Cinnabar);

        case ID.GALENA: return(Galena);

        case ID.SPHALERITE: return(Sphalerite);

        case ID.ILMENITE: return(Ilmenite);

        case ID.MAGNETITE: return(Magnetite);

        case ID.PYROLUSITE: return(Pyrolusite);

        case ID.SCHEELITE: return(Scheelite);

        case ID.JASPER_GRANITE: return(Jasper_Granite);

        case ID.JASPER_GNEISS: return(Jasper_Gneiss);

        case ID.AGATE: return(Agate);

        case ID.MOONSTONE_GRANITE: return(Moonstone_Granite);

        case ID.MOONSTONE_GNEISS: return(Moonstone_Gneiss);

        case ID.ONYX: return(Onyx);

        case ID.OPAL: return(Opal);

        case ID.ALMANDINE_GRANITE: return(Almandine_Granite);

        case ID.ALMANDINE_GNEISS: return(Almandine_Gneiss);

        case ID.LABRADORITE: return(Labradorite);

        case ID.AQUAMARINE: return(Aquamarine);

        case ID.TURQUOISE_SANDSTONE: return(Turquoise_Sandstone);

        case ID.TURQUOISE_QUARTZITE: return(Turquoise_Quartzite);

        case ID.LARIMAR: return(Larimar);

        case ID.CITRINE_GRANITE: return(Citrine_Granite);

        case ID.CITRINE_GNEISS: return(Citrine_Gneiss);

        case ID.GOLDENBERYL: return(GoldenBeryl);

        case ID.GROSSULAR_GRANITE: return(Grossular_Granite);

        case ID.GROSSULAR_GNEISS: return(Grossular_Gneiss);

        // Atlas row Y3
        case ID.EMERALD: return(Emerald);

        case ID.PERIDOT_GRANITE: return(Peridot_Granite);

        case ID.PERIDOT_GNEISS: return(Peridot_Gneiss);

        case ID.JADE: return(Jade);

        case ID.RUBY_GRANITE: return(Ruby_Granite);

        case ID.RUBY_MARBLE: return(Ruby_Marble);

        case ID.CARNELIAN: return(Carnelian);

        case ID.PYROPE_GRANITE: return(Pyrope_Granite);

        case ID.PYROPE_GNEISS: return(Pyrope_Gneiss);

        case ID.TOPAZ_GRANITE: return(Topaz_Granite);

        case ID.TOPAZ_RYOLITE: return(Topaz_Ryolite);

        case ID.SUNSTONE_GRANITE: return(Sunstone_Granite);

        case ID.SUNSTONE_GNEISS: return(Sunstone_Gneiss);

        // space for 2 on atlas here

        case ID.AMETHYST_GRANITE: return(Amethyst_Granite);

        case ID.AMETHYST_GNEISS: return(Amethyst_Gneiss);

        case ID.MORGANITE: return(Morganite);

        case ID.RHODOLITE_GRANITE: return(Rhodolite_Granite);

        case ID.RHODOLITE_GNEISS: return(Rhodolite_Gneiss);

        case ID.LAPISLAZULI_MARBLE: return(LapisLazuli_Marble);

        case ID.LAPISLAZULI_QUARTZITE: return(LapisLazuli_Quartzite);

        case ID.SAPPHIRE_GRANITE: return(Sapphite_Granite);

        case ID.SAPPHIRE_MARBLE: return(Sapphire_Marble);

        case ID.SODALITE_GRANITE: return(Sodalite_Granite);

        case ID.SODALITE_MARBLE: return(Sodalite_Marble);

        case ID.SODALITE_BASALT: return(Sodalite_Basalt);

        case ID.TIGERSEYE: return(TigersEye);

        case ID.BLOODSTONE: return(Bloodstone);

        case ID.ROCKCRYSTAL_GRANITE: return(RockCrystal_Granite);

        case ID.ROCKCRYSTAL_GNEISS: return(RockCrystal_Gneiss);

        case ID.DIAMOND: return(Diamond);

        // Atlas row Y4
        case ID.OAK_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Oak_Wood_Top);
            }
            else
            {
                return(Oak_Wood_Side);
            }

        case ID.OAK_LEAVES: return(Oak_Leaves);

        case ID.BIRCH_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Birch_Wood_Top);
            }
            else
            {
                return(Birch_Wood_Side);
            }

        case ID.BIRCH_LEAVES: return(Birch_Leaves);

        case ID.DARKOAK_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Oak_Wood_Top);
            }
            else
            {
                return(Oak_Wood_Side);
            }

        case ID.DARKOAK_LEAVES: return(DarkOak_Leaves);

        case ID.SACREDOAK_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(SacredOak_Wood_Top);
            }
            else
            {
                return(SacredOak_Wood_Side);
            }

        case ID.SACREDOAK_LEAVES: return(SacredOak_Leaves);

        case ID.SPRUCE_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Spruce_Wood_Top);
            }
            else
            {
                return(Spruce_Wood_Side);
            }

        case ID.SPRUCE_LEAVES: return(Spruce_Leaves);

        case ID.JUNGLE_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Jungle_Wood_Top);
            }
            else
            {
                return(Jungle_Wood_Side);
            }

        case ID.JUNGLE_LEAVES: return(Jungle_Leaves);

        case ID.ACACIA_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Acacia_Wood_Top);
            }
            else
            {
                return(Acacia_Wood_Side);
            }

        case ID.ACACIA_LEAVES: return(Acacia_Leaves);

        case ID.WILLOW_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Willow_Wood_Top);
            }
            else
            {
                return(Willow_Wood_Side);
            }

        case ID.WILLOW_LEAVES: return(Willow_Leaves);

        case ID.UMBRAN_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Umbran_Wood_Top);
            }
            else
            {
                return(Umbran_Wood_Side);
            }

        case ID.UMBRAN_LEAVES: return(Umbran_Leaves);

        case ID.REDWOOD_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Redwood_Wood_Top);
            }
            else
            {
                return(Redwood_Wood_Side);
            }

        case ID.REDWOOD_LEAVES: return(Redwood_Leaves);

        case ID.PINE_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Pine_Wood_Top);
            }
            else
            {
                return(Pine_Wood_Side);
            }

        // Atlas row Y5
        case ID.PINE_LEAVES: return(Pine_Leaves);

        case ID.PALM_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Palm_Wood_Top);
            }
            else
            {
                return(Palm_Wood_Side);
            }

        case ID.PALM_LEAVES: return(Palm_Leaves);

        case ID.MANGROVE_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Mangrove_Wood_Top);
            }
            else
            {
                return(Mangrove_Wood_Side);
            }

        case ID.MANGROVE_LEAVES: return(Mangrove_Leaves);

        case ID.MAHOGANY_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Mahogany_Wood_Top);
            }
            else
            {
                return(Mahogany_Wood_Side);
            }

        case ID.MAHOGANY_LEAVES: return(Mahagany_Leaves);

        case ID.MAGICAL_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Magical_Wood_Top);
            }
            else
            {
                return(Magical_Wood_Side);
            }

        case ID.MAGICAL_LEAVES: return(Magical_Leaves);

        case ID.JACARANDA_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Jacaranda_Wood_Top);
            }
            else
            {
                return(Jacaranda_Wood_Side);
            }

        case ID.JACARANDA_LEAVES: return(Jacaranda_Leaves);

        case ID.FIR_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Fir_Wood_Top);
            }
            else
            {
                return(Fir_Wood_Side);
            }

        case ID.FIR_LEAVES: return(Fir_Leaves);

        case ID.EUCALYPTUS_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Eucalyptus_Wood_Top);
            }
            else
            {
                return(Eucalyptus_Wood_Side);
            }

        case ID.EUCALYPTUS_LEAVES: return(Eucalyptus_Leaves);

        case ID.EBONY_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Ebony_Wood_Top);
            }
            else
            {
                return(Ebony_Wood_Side);
            }

        case ID.EBONY_LEAVES: return(Ebony_Leaves);

        case ID.HELLBARK_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Hellbark_Wood_Top);
            }
            else
            {
                return(Hellbark_Wood_Side);
            }

        case ID.HELLBARK_LEAVES: return(Hellbark_Leaves);

        case ID.ETHEREAL_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Ethereal_Wood_Top);
            }
            else
            {
                return(Ethereal_Wood_Side);
            }

        case ID.ETHEREAL_LEAVES: return(Ethereal_Leaves);

        case ID.CHERRY_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Cherry_Wood_Top);
            }
            else
            {
                return(Cherry_Wood_Side);
            }

        // Atlas row Y6
        case ID.CHERRY_LEAVES_WHITE: return(Cherry_Leaves_White);

        case ID.CHERRY_LEAVES_PINK: return(Cherry_Leaves_Pink);

        case ID.DEAD_WOOD:
            if (dir == Dir.Up || dir == Dir.Down)
            {
                return(Dead_Wood_Top);
            }
            else
            {
                return(Dead_Wood_Side);
            }

        case ID.DEAD_LEAVES: return(Dead_Leaves);

        default: return(new Vector2(31, 31));      // fallback texture for when something fails
        }
    }
Ejemplo n.º 43
0
 public ArrowProj(Vector2 location, Dir newDir)
 {
     position  = location;
     direction = newDir;
 }
Ejemplo n.º 44
0
        private static void CreateMSI(string LicensePath, string PathToBuild, string VersionText, string ResultBuildPath, string WixPath)
        {
            List <WixEntity> files = new List <WixEntity>();

            var paths = System.IO.Directory.GetFiles(PathToBuild);


            foreach (var path in paths)
            {
                files.Add(new File(path));

                if (path.EndsWith("MemcardRex.exe"))
                {
                    (files[files.Count - 1] as File).Shortcuts = new FileShortcut[] { new FileShortcut("MemcardRex", "INSTALLDIR"),
                                                                                      new FileShortcut("MemcardRex", @"%Desktop%"), new FileShortcut("MemcardRex", @"%ProgramMenu%/MemcardRex")
                                                                                      {
                                                                                          WorkingDirectory = "%Temp%", Arguments = "777"
                                                                                      } };
                    (files[files.Count - 1] as File).Id      = AppId;
                    (files[files.Count - 1] as File).Feature = Feature;
                }
            }


            List <WixEntity> InnerDirs = GetInnerDirs(PathToBuild);

            files.AddRange(InnerDirs);


            files.Add(new RemoveFolderEx {
                On = InstallEvent.uninstall, Property = "DIR_PATH_PROPERTY_NAME"
            });
            files.Add(new ExeFileShortcut("Uninstall MemcardRex",
                                          "[System64Folder]msiexec.exe",
                                          "/x [ProductCode]"));

            var dir = new InstallDir(@"%ProgramFiles%\MemcardRex",
                                     files.ToArray());

            var dirStartMenu = new Dir("%ProgramMenu%/MemcardRex", new ExeFileShortcut("Uninstall MemcardRex",
                                                                                       "[System64Folder]msiexec.exe",
                                                                                       "/x [ProductCode]"), new RemoveFolderEx {
                On = InstallEvent.uninstall, Property = "DIR_PATH_PROPERTY_NAME"
            });



            var project = new Project("MemcardRex",
                                      dir, dirStartMenu);

            project.Version = Version.Parse(VersionText);
            project.GUID    = new Guid("6f332b47-1434-42bd-9195-1362ba35889b");

            project.MajorUpgradeStrategy = new MajorUpgradeStrategy()
            {
                UpgradeVersions                   = VersionRange.OlderThanThis,
                PreventDowngradingVersions        = VersionRange.NewerThanThis,
                NewerProductInstalledErrorMessage = "Newer version already installed"
            };
            project.UI                  = WUI.WixUI_InstallDir;
            project.LicenceFile         = LicensePath;
            project.WixSourceGenerated += (document) => {
                var productElement = document.Root.Select("Product");

                productElement.Add(new XElement("WixVariable",
                                                new XAttribute("Id", "WixUIDialogBmp"),
                                                new XAttribute("Value", "setup_background.bmp")));



                productElement.Add(new XElement("WixVariable",
                                                new XAttribute("Id", "WixUIBannerBmp"),
                                                new XAttribute("Value", "setup_icon.bmp")));
            };

            Environment.SetEnvironmentVariable("WIXSHARP_WIXDIR", WixPath);
            Compiler.WixLocation  = WixPath;
            Compiler.LightOptions = "-sval -sh";
            Console.WriteLine("Starting building MSI.");
            Compiler.BuildMsi(project, ResultBuildPath);
        }
Ejemplo n.º 45
0
 private static Dir Turn(Dir d, bool left)
 {
     return((Dir)(((int)d + (left ? 3 : 1)) % 4));
 }
Ejemplo n.º 46
0
 public static TagButton dir(this TagButton tag, Dir value)
 {
     tag.Dir = value; return(tag);
 }
Ejemplo n.º 47
0
    public Vector3 ConvertDirToVector3(Dir dir)
    {
        float angle = (float)(dir.angle) / 10000;

        return(new Vector3((float)Math.Cos(angle), 0, (float)Math.Sin(angle)));
    }
 /// <summary>
 /// Return the (possibly null) neighbor in a given direction.
 /// </summary>
 /// <param name="neighbor"></param>
 /// <returns></returns>
 public HeightMap this[Dir neighbor]
 {
     get { return(maps[(int)neighbor]); }
     set { maps[(int)neighbor] = value; }
 }
Ejemplo n.º 49
0
    public Vector3 FindTopLeftVertex(Vector3 firstVertex, float stepX, float stepZ, Vector3[] vertices)
    {
        Dir quadrant = FindVertexQuadrant(firstVertex, Input.mousePosition);

        return(FindTopLeftVertex(firstVertex, quadrant, stepX, stepZ, vertices));
    }
Ejemplo n.º 50
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("PatrolPoint"))
        {
            if (canMove && isAlive)
            {
                PatrolPointScript point = other.GetComponent <PatrolPointScript>();

                Vector2 compare = transform.position - player.transform.position;

                int rand = Random.Range(0, point.points.Length + 1);

                if (rand == 0)
                {
                    if (currGround != point.platformParent)
                    {
                        currGround = point.platformParent;

                        for (int i = 0; i < LevelManagerScript.instance.platformers.Count; i++)
                        {
                            LevelManagerScript.instance.platformers[i].walkers.Remove(this);
                        }

                        LevelManagerScript.instance.platformers[point.parentNum].walkers.Add(this);
                    }

                    if (point.side == Dir.RIGHT)
                    {
                        if (currDir == Dir.RIGHT)
                        {
                            currDir = Dir.LEFT;
                        }
                    }
                    else if (point.side == Dir.LEFT)
                    {
                        if (currDir == Dir.LEFT)
                        {
                            currDir = Dir.RIGHT;
                        }
                    }
                }
                else
                {
                    if (point.points[rand - 1].dir == Dir.DOWN)
                    {
                        if (currGround != point.points[rand - 1].connectedPoint.platformParent)
                        {
                            currGround = point.points[rand - 1].connectedPoint.platformParent;

                            for (int i = 0; i < LevelManagerScript.instance.platformers.Count; i++)
                            {
                                LevelManagerScript.instance.platformers[i].walkers.Remove(this);
                            }

                            LevelManagerScript.instance.platformers[point.points[rand - 1].connectedPoint.parentNum].walkers.Add(this);
                        }

                        StartCoroutine(Hop(point.points[rand - 1].connectedPoint.transform.position, 1f, transform.position.y + 1.5f));

                        if (point.points[rand - 1].connectedPoint.side == Dir.RIGHT)
                        {
                            if (currDir != Dir.LEFT)
                            {
                                currDir = Dir.LEFT;
                            }
                        }
                        else if (point.points[rand - 1].connectedPoint.side == Dir.LEFT)
                        {
                            if (currDir != Dir.RIGHT)
                            {
                                currDir = Dir.RIGHT;
                            }
                        }
                    }
                    else
                    {
                        if (currGround != point.points[rand - 1].connectedPoint.platformParent)
                        {
                            currGround = point.points[rand - 1].connectedPoint.platformParent;

                            for (int i = 0; i < LevelManagerScript.instance.platformers.Count; i++)
                            {
                                LevelManagerScript.instance.platformers[i].walkers.Remove(this);
                            }

                            LevelManagerScript.instance.platformers[point.points[rand - 1].connectedPoint.parentNum].walkers.Add(this);
                        }

                        StartCoroutine(Hop(point.points[rand - 1].connectedPoint.transform.position, 1f, point.points[rand - 1].connectedPoint.transform.position.y + 1.5f));
                    }
                }

                //			if(isHunting)
                //			{
                //				if(compare.y < 0)
                //				{
                //					bool found = false;
                //
                //					if(compare.x >= 0)
                //					{
                //						if(point.side == Dir.LEFT)
                //						{
                //							for(int i = 0; i < point.points.Length; i++)
                //							{
                //								if(point.points[i].dir == Dir.UP)
                //								{
                //									StartCoroutine(Hop(point.points[i].connectedPoint.transform.position, 1f, point.points[i].connectedPoint.transform.position.y + 2.5f));
                //
                //									found = true;
                //								}
                //							}
                //						}
                //					}
                //					else
                //					{
                //						if(point.side == Dir.RIGHT)
                //						{
                //							for(int i = 0; i < point.points.Length; i++)
                //							{
                //								if(point.points[i].dir == Dir.UP)
                //								{
                //									StartCoroutine(Hop(point.points[i].connectedPoint.transform.position, 1f, point.points[i].connectedPoint.transform.position.y + 2.5f));
                //
                //									found = true;
                //								}
                //							}
                //						}
                //					}
                //
                //
                //
                //					if(!found)
                //					{
                //						if(currDir == Dir.RIGHT)
                //						{
                //							currDir = Dir.LEFT;
                //						}
                //						else if(currDir == Dir.LEFT)
                //						{
                //							currDir = Dir.RIGHT;
                //						}
                //					}
                //				}
                //				else
                //				{
                //					bool found = false;
                //
                //					if(compare.x >= 0)
                //					{
                //						if(point.side == Dir.LEFT)
                //						{
                //							for(int i = 0; i < point.points.Length; i++)
                //							{
                //								if(point.points[i].dir == Dir.DOWN)
                //								{
                //									StartCoroutine(Hop(point.points[i].connectedPoint.transform.position, 1f, transform.position.y + 2.5f));
                //
                //									found = true;
                //								}
                //							}
                //						}
                //					}
                //					else
                //					{
                //						if(point.side == Dir.RIGHT)
                //						{
                //							for(int i = 0; i < point.points.Length; i++)
                //							{
                //								if(point.points[i].dir == Dir.DOWN)
                //								{
                //									StartCoroutine(Hop(point.points[i].connectedPoint.transform.position, 1f, transform.position.y + 2.5f));
                //
                //									found = true;
                //								}
                //							}
                //						}
                //					}
                //
                //
                //					if(!found)
                //					{
                //						if(currDir == Dir.RIGHT)
                //						{
                //							currDir = Dir.LEFT;
                //						}
                //						else if(currDir == Dir.LEFT)
                //						{
                //							currDir = Dir.RIGHT;
                //						}
                //					}
                //				}
                //			}
                //			else
                //			{
                //				int rand = Random.Range(0, point.points.Length);
                //
                //				if(rand == 0)
                //				{
                //					if(point.side == Dir.RIGHT)
                //					{
                //						if(currDir == Dir.RIGHT)
                //						{
                //							currDir = Dir.LEFT;
                //						}
                //					}
                //					else if(point.side == Dir.LEFT)
                //					{
                //						if(currDir == Dir.LEFT)
                //						{
                //							currDir = Dir.RIGHT;
                //						}
                //					}
                //				}
                //				else
                //				{
                //					if(point.points[rand - 1].dir == Dir.DOWN)
                //					{
                //						StartCoroutine(Hop(point.points[rand - 1].connectedPoint.transform.position, 1f, transform.position.y + 2.5f));
                //					}
                //					else
                //					{
                //						StartCoroutine(Hop(point.points[rand - 1].connectedPoint.transform.position, 1f, point.points[rand - 1].connectedPoint.transform.position.y + 2.5f));
                //
                //					}
                //				}
                //
                //			}
            }
        }
    }
Ejemplo n.º 51
0
        private void DrawElement(int x, int y, int texture, Dir direction, float moveX, float moveY, int width, int height, float z)
        {
            z = -z;
            width--;
            height--;
            //Gl.glPushMatrix();
            //Gl.glTranslatef(x + moveX, y + moveY, 0);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture);
            //Gl.glBegin(Gl.GL_TRIANGLE_FAN);
            vertexData.vertex[0]  = -0.5f + x + moveX;
            vertexData.vertex[1]  = -0.5f + y + moveY;
            vertexData.vertex[2]  = z;
            vertexData.vertex[3]  = 0.5f + x + moveX + width;
            vertexData.vertex[4]  = -0.5f + y + moveY;
            vertexData.vertex[5]  = z;
            vertexData.vertex[6]  = 0.5f + x + moveX + width;
            vertexData.vertex[7]  = 0.5f + y + moveY + height;
            vertexData.vertex[8]  = z;
            vertexData.vertex[9]  = -0.5f + x + moveX;
            vertexData.vertex[10] = 0.5f + y + moveY + height;
            vertexData.vertex[11] = z;
            switch (direction)
            {
            case Dir.N:
                vertexData.uv[0] = 0; vertexData.uv[1] = 0;
                vertexData.uv[2] = 1; vertexData.uv[3] = 0;
                vertexData.uv[4] = 1; vertexData.uv[5] = 1;
                vertexData.uv[6] = 0; vertexData.uv[7] = 1;
                break;

            case Dir.E:
                vertexData.uv[2] = 0; vertexData.uv[3] = 0;
                vertexData.uv[4] = 1; vertexData.uv[5] = 0;
                vertexData.uv[6] = 1; vertexData.uv[7] = 1;
                vertexData.uv[0] = 0; vertexData.uv[1] = 1;
                break;

            case Dir.S:
                vertexData.uv[4] = 0; vertexData.uv[5] = 0;
                vertexData.uv[6] = 1; vertexData.uv[7] = 0;
                vertexData.uv[0] = 1; vertexData.uv[1] = 1;
                vertexData.uv[2] = 0; vertexData.uv[3] = 1;
                break;

            case Dir.W:
                vertexData.uv[6] = 0; vertexData.uv[7] = 0;
                vertexData.uv[0] = 1; vertexData.uv[1] = 0;
                vertexData.uv[2] = 1; vertexData.uv[3] = 1;
                vertexData.uv[4] = 0; vertexData.uv[5] = 1;
                break;
            }

            //Gl.glPushMatrix();
            if (magicCheckBox.Checked)
            {
                Gl.glPushMatrix();
                float f = (float)(Environment.TickCount - startingTick) * 0.00001f;
                Gl.glRotatef(f * (x + Simulation.simulation.Map.Width * y), 1, 1, 1);
            }
            Gl.glDrawElements(Gl.GL_TRIANGLE_FAN, 4, Gl.GL_UNSIGNED_SHORT, vertexData.intPointers[2]);
            if (magicCheckBox.Checked)
            {
                Gl.glPopMatrix();
            }
        }
Ejemplo n.º 52
0
 public static TagAbbr dir(this TagAbbr tag, Dir value)
 {
     tag.Dir = value; return(tag);
 }
Ejemplo n.º 53
0
    public void DefineOfState()
    {
        if (Input.GetKey(KeyCode.LeftArrow) && !Input.GetKeyDown(KeyCode.A))
        {
            dir = Dir.LEFT;
            if (bulletGap > 0)
            {
                bulletGap = (-2 - col2d.bounds.size.x / 2);
                //float gunAngle = GetToMouseAngle(this.transform.position.x, this.transform.position.y) + 90;
                this.transform.rotation = Quaternion.Euler(0, 180, 0);
            }

            //state = PLAYERSTATE.MOVE;

            if (state != PLAYERSTATE.JUMP)
            {
                state = PLAYERSTATE.MOVE;
            }
            else
            {
                state = PLAYERSTATE.MOVEJUMP;
            }
        }
        else if (Input.GetKey(KeyCode.RightArrow) && !Input.GetKeyDown(KeyCode.A))
        {
            dir = Dir.RIGHT;
            if (bulletGap < 0)
            {
                bulletGap = (2 + col2d.bounds.size.x / 2);
                //float gunAngle = GetToMouseAngle(this.transform.position.x, this.transform.position.y) + 90;
                //this.transform.rotation = Quaternion.Euler(0, 0, 0);
                this.transform.rotation = Quaternion.Euler(0, 0, 0);
            }

            if (state != PLAYERSTATE.JUMP)
            {
                state = PLAYERSTATE.MOVE;
            }
            else
            {
                state = PLAYERSTATE.MOVEJUMP;
            }
        }
        else if (Input.GetKeyUp(KeyCode.RightArrow) || Input.GetKeyUp(KeyCode.LeftArrow))
        {
            if (state != PLAYERSTATE.JUMP && state != PLAYERSTATE.MOVEJUMP)
            {
                state = PLAYERSTATE.IDLE;
            }
        }

        //if (state != PLAYERSTATE.JUMP) //&& state != PLAYERSTATE.MOVEJUMP)
        //{
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (state != PLAYERSTATE.JUMP)
            {
                //collisionGround = false;
                state = PLAYERSTATE.JUMP;
                Debug.Log("점프");
            }
        }
        //}

        if (Input.GetKeyDown(KeyCode.A))
        {
            state = PLAYERSTATE.FIRE;
            //Instantiate(Bullet, this.transform.position, this.transform.rotation);
            //Instantiate(Bullet, this.transform.position, this.transform.rotation);
        }

        if (Input.GetKeyDown(KeyCode.A) && Input.GetKeyDown(KeyCode.LeftArrow))
        {
            state = PLAYERSTATE.MOVEFIRE;
        }
        else if (Input.GetKeyDown(KeyCode.A) && Input.GetKeyDown(KeyCode.RightArrow))
        {
            state = PLAYERSTATE.MOVEFIRE;
        }
        //Fire 푸는건 애니메이션이 다 돌았을 때 풀어야 함. 따라서 해당 스프라이트가 얼마 간격으로 움직이나가 필요.
    }
Ejemplo n.º 54
0
        public static void Main()
        {
            DirAtTargetSettings settings = DirAtTargetSettings.Default;

            Dir.CreateFileList(settings.StickDrive, settings.TargetPath);
        }
Ejemplo n.º 55
0
        // Enqueue the operations needed to reach currentDest in the database
        private void findRoute(string currPos, Dir dir)
        {
            float angle = picture.getAngle();
            Dir   newDir;
            int   Trow  = (int)currentDest[0];
            int   Tcol  = (int)currentDest[1];
            int   CProw = (int)currPos[0];
            int   CPcol = (int)currPos[1];

            string.Format("{0:00}", angle);
            if (Trow - CProw > 0)
            {
                //ALERT! BACKWARD2 used because no BACKWARD was found
                switch (dir)
                {
                case Dir.NORTH:
                    addOperation("B" + angle.ToString());
                    break;

                case Dir.SOUTH:
                    addOperation("F" + angle.ToString());
                    break;

                case Dir.EAST:
                    addOperation("R" + angle.ToString());
                    break;

                default:
                    addOperation("L" + angle.ToString());
                    break;
                }
                newDir = Dir.SOUTH;
            }
            else if (Trow - CProw < 0)
            {
                switch (dir)
                {
                case Dir.NORTH:
                    addOperation("F" + angle.ToString());
                    break;

                case Dir.SOUTH:
                    addOperation("B" + angle.ToString());
                    break;

                case Dir.EAST:
                    addOperation("L" + angle.ToString());
                    break;

                default:
                    addOperation("R" + angle.ToString());
                    break;
                }
                newDir = Dir.NORTH;
            }
            else
            {
                newDir = dir;
            }
            for (int i = 1; i < Math.Abs(Trow - CProw); i++)
            {
                addOperation("F" + angle.ToString());
            }

            if (Tcol - CPcol > 0)
            {
                //ALERT! BACKWARD2 used because no BACKWARD was found
                switch (newDir)
                {
                case Dir.NORTH:
                    addOperation("R" + angle.ToString());
                    break;

                case Dir.SOUTH:
                    addOperation("L" + angle.ToString());
                    break;

                case Dir.EAST:
                    addOperation("F" + angle.ToString());
                    break;

                default:
                    addOperation("B" + angle.ToString());
                    break;
                }
            }
            else if (Tcol - CPcol < 0)
            {
                switch (newDir)
                {
                case Dir.NORTH:
                    addOperation("L" + angle.ToString());
                    break;

                case Dir.SOUTH:
                    addOperation("R" + angle.ToString());
                    break;

                case Dir.EAST:
                    addOperation("B" + angle.ToString());
                    break;

                default:
                    addOperation("F" + angle.ToString());
                    break;
                }
            }
            for (int i = 1; i < Math.Abs(Tcol - CPcol); i++)
            {
                addOperation("F" + angle.ToString());
            }
        }
Ejemplo n.º 56
0
    public ServerInstaller(string version, string arch)
    {
        string upgradeGuid = "03E9476F-0F75-4661-BFC9-A9DAEB23D3A0";

        string[] binaries =
        {
            "murmur.exe",
            "Murmur.ice"
        };

        string[] licenses =
        {
            "qt.txt",
            "gpl.txt",
            "speex.txt",
            "lgpl.txt",
            "Mumble.rtf"
        };

        if (arch == "x64")
        {
            // 64 bit
            this.Platform = WixSharp.Platform.x64;
        }
        else if (arch == "x86")
        {
            // 32 bit
            this.Platform = WixSharp.Platform.x86;
        }

        this.Name        = "Mumble (server)";
        this.UpgradeCode = Guid.Parse(upgradeGuid);
        this.Version     = new Version(version);
        this.OutFileName = "mumble_server-" + this.Version + "-" + arch;

        var progsDir     = new Dir(@"%ProgramFiles%");
        var productDir   = new Dir("Mumble");
        var installDir   = new Dir("server");
        var licenseDir   = new Dir("licenses");
        var menuDir      = new Dir(@"%ProgramMenu%");
        var shortcutDir  = new Dir("Mumble");
        var menuShortcut = new ExeFileShortcut("Murmur", "[INSTALLDIR]murmur.exe", arguments: "");

        menuShortcut.IconFile = @"..\icons\murmur.ico";
        shortcutDir.Shortcuts = new ExeFileShortcut[] { menuShortcut };

        var binaryFiles  = new File[binaries.Length];
        var licenseFiles = new File[licenses.Length];

        for (int i = 0; i < binaries.Length; i++)
        {
            binaryFiles[i] = new File(@"..\..\" + binaries[i]);
        }

        for (int i = 0; i < licenses.Length; i++)
        {
            licenseFiles[i] = new File(@"..\..\licenses\" + licenses[i]);
        }

        installDir.Files = binaryFiles;
        licenseDir.Files = licenseFiles;

        menuDir.Dirs    = new Dir[] { shortcutDir };
        installDir.Dirs = new Dir[] { licenseDir };
        productDir.Dirs = new Dir[] { installDir };
        progsDir.Dirs   = new Dir[] { productDir };

        this.Dirs = new Dir[] {
            progsDir,
            menuDir
        };
    }
Ejemplo n.º 57
0
 public static string Path(Dir dir, string filename)
 {
     return(Path(dir, null, filename));
 }
Ejemplo n.º 58
0
        // ----------------------
        override protected void OnUpdateAnimator(bool skipAnim)
        {
#if UNITY_EDITOR
            if (!UnityEditor.EditorApplication.isPlaying)
            {
                //this.CheckHierarchy();
                //return;
            }
#endif

            TouchJoystick joystick = (TouchJoystick)this.sourceControl;

            if ((joystick == null) || (this.image == null))
            {
                return;
            }


            JoystickState joyState = joystick.GetState();     //false); //this.useVirtualJoystickState);



            SpriteConfig sprite = null;

            if ((this.spriteMode == SpriteMode.FourWay) || (this.spriteMode == SpriteMode.EightWay))
            {
                Dir curDir = Dir.N;

                if (this.spriteMode == SpriteMode.FourWay)
                {
                    curDir = joyState.GetDir4();
                }
                else if (this.spriteMode == SpriteMode.EightWay)
                {
                    curDir = joyState.GetDir4();
                }

                switch (curDir)
                {
                case Dir.U: sprite = this.spriteUp; break;

                case Dir.UR: sprite = this.spriteUpRight; break;

                case Dir.R: sprite = this.spriteRight; break;

                case Dir.DR: sprite = this.spriteDownRight; break;

                case Dir.D: sprite = this.spriteDown; break;

                case Dir.DL: sprite = this.spriteDownLeft; break;

                case Dir.L: sprite = this.spriteLeft; break;

                case Dir.UL: sprite = this.spriteUpLeft; break;
                }
            }


            if (joystick.Pressed() && ((sprite == null) || !sprite.enabled))
            {
                sprite = this.spriteNeutralPressed;
            }


            if (((sprite == null) || !sprite.enabled))
            {
                sprite = this.spriteNeutral;
            }


            if (!CFUtils.editorStopped && !this.IsIllegallyAttachedToSource())
            {
                if (this.animateTransl)
                {
                    this.extraOffset = CFUtils.SmoothTowardsVec2(this.extraOffset, Vector2.Scale(joyState.GetVector(), this.moveScale),
                                                                 this.translationSmoothingTime, CFUtils.realDeltaTimeClamped, 0.0001f);
                }
                else
                {
                    this.extraOffset = Vector2.zero;
                }


                if (this.rotationMode != RotationMode.Disabled)
                {
                    float targetAngle = 0;

                    if (joystick.Pressed())
                    {
                        Vector2 v = joyState.GetVectorEx((joystick.shape == TouchControl.Shape.Rectangle) || (joystick.shape == TouchControl.Shape.Square));

                        if (this.rotationMode == RotationMode.Compass)
                        {
                            if (v.sqrMagnitude > 0.0001f)
                            {
                                this.lastSafeCompassAngle = joyState.GetAngle();          //CFUtils.VecToAngle(v.normalized);
                            }
                            targetAngle = -this.lastSafeCompassAngle;                     //targetRotation = Quaternion.Euler(0, 0, -this.lastSafeCompassAngle);
                        }
                        else
                        {
                            targetAngle = ((this.rotationMode == RotationMode.SimpleHorizontal) ? v.x : v.y) * -this.simpleRotationRange;
                        }
                    }
                    else
                    {
                        this.lastSafeCompassAngle = 0;
                        targetAngle = 0;
                    }


                    this.extraRotation = CFUtils.SmoothTowardsAngle(this.extraRotation, targetAngle,
                                                                    this.rotationSmoothingTime, CFUtils.realDeltaTimeClamped, 0.0001f);
                }
            }



            this.BeginSpriteAnim(sprite, skipAnim);

            this.UpdateSpriteAnimation(skipAnim);
        }
Ejemplo n.º 59
0
 public void CreateBuild(IBuildable proto, Tile tile, Dir dir)
 => AddJob(new JobBuild(this, virtualDefs.Get(proto), tile, dir));
Ejemplo n.º 60
0
        static void Main(string[] args)
        {
            var doc = new Doc();

            // Changes
            {
                doc = doc[T.H1("Release Notes")];
                foreach (var change in Config.Release)
                {
                    doc = doc[change];
                }
            }

            // headers only library.
            {
                doc = doc
                      [T.H1("Headers Only Libraries")]
                      [T.List[A("boost", Config.Version)]];
                var path     = Path.Combine(Config.BoostDir, "boost");
                var fileList =
                    new Dir(new DirectoryInfo(path), "boost").
                    FileList(f => true);
                Nuspec.Create(
                    "boost",
                    "boost",
                    Config.Version,
                    "boost",
                    new[]
                {
                    new Targets.ItemDefinitionGroup(
                        clCompile:
                        new Targets.ClCompile(
                            additionalIncludeDirectories:
                            new[]
                    {
                        Targets.PathFromThis(
                            Targets.IncludePath)
                    }
                            )
                        )
                },
                    fileList.Select(
                        f =>
                        new Nuspec.File(
                            Path.Combine(Config.BoostDir, f),
                            Path.Combine(Targets.IncludePath, f)
                            )
                        ),
                    new CompilationUnit[0],
                    new Nuspec.Dependency[0],
                    new[] { "headers" }
                    );
            }

            // source libraries.
            doc = doc[T.H1("Source Libraries")];
            var srcLibList = new List <string>();

            foreach (var directory in Directory
                     .GetDirectories(Path.Combine(Config.BoostDir, "libs")))
            {
                var src = Path.Combine(directory, "src");
                if (Directory.Exists(src))
                {
                    var name = Path.GetFileName(directory);

                    var libraryConfig = Config
                                        .LibraryList
                                        .Where(l => l.Name == name)
                                        .FirstOrDefault()
                                        ?? new Library(name);

                    foreach (var libName in MakeSrcLibrary(libraryConfig, src))
                    {
                        var fullName = "boost_" + libName + "-src";
                        srcLibList.Add(libName);
                        doc = doc[T.List[A(
                                             libName, fullName, Config.Version)]];
                    }
                }
            }
            Nuspec.Create(
                "boost-src",
                "boost-src",
                Config.Version,
                "boost-src",
                Enumerable.Empty <Targets.ItemDefinitionGroup>(),
                Enumerable.Empty <Nuspec.File>(),
                Enumerable.Empty <CompilationUnit>(),
                srcLibList.Select(srcLib => new Nuspec.Dependency(
                                      "boost_" + srcLib + "-src", Config.Version.ToString())),
                new[] { "sources" });

            // create dictionaries for binary NuGet packages.
            doc = doc[T.H1("Precompiled Libraries")];

            // compiler -> (library name -> pacakge)
            var compilerDictionary =
                new Dictionary <string, Dictionary <string, CompiledPackage> >();

            // library name -> library.
            var libraryDictionary = new Dictionary <string, CompiledLibrary>();

            foreach (var platform in Config.PlatformList)
            {
                ScanCompiledFileSet(
                    compilerDictionary, libraryDictionary, platform);
            }

            // all libraries for specific compiler.
            {
                var list = T.List[T.Text("all libraries")];
                foreach (var compiler in compilerDictionary.Keys)
                {
                    var id = "boost-" + compiler;
                    var compilerLibraries = compilerDictionary[compiler];
                    CreateBinaryNuspec(
                        id,
                        compiler,
                        Enumerable.Empty <Targets.ItemDefinitionGroup>(),
                        Enumerable.Empty <Nuspec.File>(),
                        compilerLibraries
                        .Keys
                        .Select(lib => SrcPackage.Dependency(lib, compiler)),
                        Optional <string> .Absent.Value,
                        compilerLibraries
                        .Values
                        .SelectMany(package => package.PlatformList)
                        .Distinct());
                    list = list
                           [T.Text(" ")]
                           [A(
                                compiler,
                                id,
                                SrcPackage.CompilerVersion(Config.CompilerMap[compiler]))];
                }
                doc = doc[list];
            }

            //
            var itemDefinitionGroupList =
                Config.
                PlatformList.
                Select(
                    p =>
                    new Targets.ItemDefinitionGroup(
                        condition: "'$(Platform)'=='" + p.Name + "'",
                        link:
                        new Targets.Link(
                            additionalLibraryDirectories:
                            new[]
            {
                Targets.PathFromThis(
                    Path.Combine(
                        Targets.LibNativePath,
                        p.Directory)
                    )
            }
                            )
                        )
                    );

            // NuGet packages for each library.
            foreach (var library in libraryDictionary)
            {
                var name      = library.Key;
                var libraryId = "boost_" + name;
                var list      = T.List[T.Text(name)];
                foreach (var package in library.Value.PackageDictionary)
                {
                    var compiler     = package.Key;
                    var packageValue = package.Value;
                    var nuspecId     = libraryId + "-" + compiler;
                    CreateBinaryNuspec(
                        nuspecId,
                        compiler,
                        itemDefinitionGroupList,
                        packageValue.FileList.Select(
                            f =>
                            new Nuspec.File(
                                Path.Combine(Config.BoostDir, f),
                                Path.Combine(Targets.LibNativePath, f)
                                )
                            ),
                        SrcPackage.BoostDependency,
                        name.ToOptional(),
                        packageValue.PlatformList);
                    list = list
                           [T.Text(" ")]
                           [A(
                                package.Key,
                                nuspecId,
                                SrcPackage.CompilerVersion(Config.CompilerMap[compiler]))];
                }
                doc = doc[list];
            }

            // release.md
            using (var file = new StreamWriter("RELEASE.md"))
            {
                doc.Write(file);
            }
        }