コード例 #1
0
ファイル: fTools.cs プロジェクト: Xabis/PathTools
        public fTools(BuilderPlug p)
        {
            InitializeComponent();

             nodes = new PathNodes();
             nodes.NodesChanged += nodes_NodesChanged;
             plug = p;
             plug.MapDataChanged += plug_MapDataChanged;

             PopulatePathList();
        }
コード例 #2
0
        public Models.BackupPlanPathNode CreateOrUpdatePathNodes(Models.StorageAccount account, Models.BackupPlanFile file)
        {
            PathNodes pathNodes = new PathNodes(file.Path);

            bool nodeExists = true;             // Start assuming it exists.

            Models.BackupPlanPathNode previousNode = null;
            Models.BackupPlanPathNode planPathNode = null;
            foreach (var pathNode in pathNodes.Nodes)
            {
                // If it does not exist, it does not make sense to lookup inner directories/files.
                if (nodeExists)
                {
                    planPathNode = _dao.GetByStorageAccountAndTypeAndPath(
                        account, Models.EntryTypeExtensions.ToEntryType(pathNode.Type), pathNode.Path);

                    // If we couldn't find the current `Models.BackupPlanPathNode`, it's safe to assume the inner
                    // directories/files don't exist either. From now on, all nodes will be created/inserted.
                    if (planPathNode == null)
                    {
                        nodeExists = false;
                    }
                }

                if (!nodeExists)
                {
                    //BackupPlanFile planFile = daoBackupPlanFile.GetByPlanAndPath(Backup.BackupPlan, file.Path);
                    //Assert.NotNull(planFile, string.Format("Required {0} not found in the database.", typeof(BackupPlanFile).Name))
                    planPathNode = new Models.BackupPlanPathNode(file,
                                                                 Models.EntryTypeExtensions.ToEntryType(pathNode.Type),
                                                                 pathNode.Name, pathNode.Path, previousNode);

                    if (previousNode != null)
                    {
                        planPathNode.Parent = previousNode;
                        previousNode.SubNodes.Add(planPathNode);
                    }


                    _dao.Insert(_tx, planPathNode);
                    _dao.Refresh(planPathNode);
                }

                previousNode = planPathNode;

                //session.Evict(planPathNode); // Force future queries to re-load it and its relationships.
            }

            return(previousNode);
        }
コード例 #3
0
        private void ExpandCheckedDataSourceAddParents(Dictionary <string, BackupPlanTreeNodeData> expandedDict, string path)
        {
            PathNodes nodes      = new PathNodes(path);
            PathNode  nodeParent = nodes.ParentNode;

            while (nodeParent != null)
            {
                EntryTreeNodeData newTag = null;
                switch (nodeParent.Type)
                {
                default: throw new ArgumentException("Unhandled TypeEnum", "nodeParent.Type");

                case PathNode.TypeEnum.FILE:
                {
                    EntryInfo info = new EntryInfo(TypeEnum.FILE, nodeParent.Name, nodeParent.Path);
                    newTag       = new BackupPlanTreeNodeData(StorageAccount, info);
                    newTag.State = CheckState.Mixed;
                    break;
                }

                case PathNode.TypeEnum.FOLDER:
                {
                    EntryInfo info = new EntryInfo(TypeEnum.FOLDER, nodeParent.Name, nodeParent.Path);
                    newTag       = new BackupPlanTreeNodeData(StorageAccount, info);
                    newTag.State = CheckState.Mixed;
                    break;
                }

                case PathNode.TypeEnum.DRIVE:
                {
                    EntryInfo info = new EntryInfo(TypeEnum.DRIVE, nodeParent.Name, nodeParent.Path);
                    newTag       = new BackupPlanTreeNodeData(StorageAccount, info);
                    newTag.State = CheckState.Mixed;
                    break;
                }
                }

                if (newTag != null)
                {
                    if (!expandedDict.ContainsKey(nodeParent.Path))
                    {
                        expandedDict.Add(nodeParent.Path, newTag as BackupPlanTreeNodeData);
                    }
                }

                nodeParent = nodeParent.Parent;
            }
        }
コード例 #4
0
        private void ExpandCheckedDataSourceAddParents(Dictionary <string, FileSystemTreeNodeData> expandedDict, string path)
        {
            PathNodes nodes      = new PathNodes(path);
            PathNode  nodeParent = nodes.ParentNode;

            while (nodeParent != null)
            {
                EntryTreeNodeData newTag = null;
                switch (nodeParent.Type)
                {
                case PathNode.TypeEnum.FILE:
                {
                    EntryInfo info = new EntryInfo(TypeEnum.FILE, nodeParent.Name, nodeParent.Path);
                    newTag       = new FileSystemTreeNodeData(info);
                    newTag.State = CheckState.Mixed;
                    break;
                }

                case PathNode.TypeEnum.FOLDER:
                {
                    EntryInfo info = new EntryInfo(TypeEnum.FOLDER, nodeParent.Name, nodeParent.Path);
                    newTag       = new FileSystemTreeNodeData(info);
                    newTag.State = CheckState.Mixed;
                    break;
                }

                case PathNode.TypeEnum.DRIVE:
                {
                    EntryInfo info = new EntryInfo(TypeEnum.DRIVE, nodeParent.Name, nodeParent.Path);
                    newTag       = new FileSystemTreeNodeData(info);
                    newTag.State = CheckState.Mixed;
                    break;
                }
                }

                if (newTag != null)
                {
                    if (!expandedDict.ContainsKey(nodeParent.Path))
                    {
                        expandedDict.Add(nodeParent.Path, newTag as FileSystemTreeNodeData);
                    }
                }

                nodeParent = nodeParent.Parent;
            }
        }
コード例 #5
0
        private PathNode RegisterParent(string name)
        {
            _nodeSource += 1;

            var di = new DirectoryInfo(name);

            var parentNode = new PathNode()
            {
                Name       = di.FullName,
                PathNodeId = _nodeSource,
            };

            PathNodes.Add(parentNode);

            Console.WriteLine($"Root Name {_nodeSource} {parentNode.Name} {parentNode.PathNodeId}");

            return(parentNode);
        }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        GameObject go = (GameObject)Instantiate(Resources.Load(slova.sledece().ToString() + "vsPrefab"));

        if (checkPrefs.current_user._ruka == "леворук")
        {
            GameObject.Find("Slike").GetComponent <UIWidget> ().leftAnchor.absolute = -1670;
            Camera.main.transform.position = new Vector3(-3.7f, -0.18f, -10f);
        }
        PathNodes pn = (PathNodes)Camera.main.GetComponent <PathNodes> ();

        pn.novoSlovo(go.name);
        //if(Screen.width>840f && Screen.width<900f)scale=800f;
        //	if(Screen.width>900f)scale=850f;
        //	Debug.Log ("DPI : " +Screen.dpi);
        //	log.text=  Screen.dpi.ToString ();
        //	leftPanel.transform.localPosition  = new Vector3(0-Screen.width*(scale/Screen.width) ,leftPanel.transform.localPosition.y,leftPanel.transform.localPosition.z);
        //	rightPanel.transform.localPosition = new Vector3(Screen.width*(scale/Screen.width) ,rightPanel.transform.localPosition.y,rightPanel.transform.localPosition.z);
        InvokeRepeating("pokreniVremeIgre", 0.5f, 0.1f);
    }
コード例 #7
0
        public void Execute()
        {
            if (MovementAction != MovementAction.None)
            {
                // check for obstacles in our way
                if (WowInterface.MovementSettings.EnableTracelineJumpCheck &&
                    !JumpOnNextMove &&
                    ObstacleCheckEvent.Run())
                {
                    Vector3 pos = BotUtils.MoveAhead(WowInterface.ObjectManager.Player.Position, WowInterface.ObjectManager.Player.Rotation, WowInterface.MovementSettings.ObstacleCheckDistance);

                    if (!WowInterface.HookManager.WowIsInLineOfSight(WowInterface.ObjectManager.Player.Position, pos, WowInterface.MovementSettings.ObstacleCheckHeight))
                    {
                        JumpOnNextMove = true;
                    }
                }

                if (ShortcutPosition == default)
                {
                    ShortcutPosition = TargetPosition;
                }

                if (ActiveShortcut != null && ActiveShortcut.UseShortcut(WowInterface.ObjectManager.Player.Position, ShortcutPosition, out Vector3 shortcutPosition, out bool shortcutUsePathfinding))
                {
                    TargetPosition = shortcutPosition;

                    if (!shortcutUsePathfinding)
                    {
                        PathNodes.Clear();
                        MovementAction  = MovementAction.DirectMove;
                        ForceDirectMove = true;
                    }
                }
                else
                {
                    ShortcutPosition = default;
                }

                BehaviorTree.Tick();
                ForceDirectMove = false;
            }
コード例 #8
0
ファイル: PathContainer.cs プロジェクト: pizzaboy314/LD32
        public PathContainer(GameObject RegionContainer)
        {
            GameObject[] regions;
            paths = new List <PathNodes> ();

            int numRegions = 0;

            foreach (Transform region in RegionContainer.transform)               //get the number of regions
            {
                numRegions++;
            }

            //output the num regions for reference
            Debug.Log("Current Number Of Regions: " + numRegions);

            regions = new GameObject[numRegions];             //create a region list
            foreach (Transform region in RegionContainer.transform)
            {
                //Debug.Log (region.GetComponent<RegionView> ().UNIQUE_ID);
                regions [region.GetComponent <RegionView> ().UNIQUE_ID] = region.gameObject;
            }

            //load in the paths into a data structure
            StreamReader sr = new StreamReader(Application.dataPath + "/StreamingAssets/paths.txt");

            while (!sr.EndOfStream)
            {
                string[] nodeNumbersStrings = sr.ReadLine().Split(',');

                List <int> nodeNumbersInts = new List <int>();
                foreach (string numString in nodeNumbersStrings)
                {
                    nodeNumbersInts.Add(int.Parse(numString));
                }
                PathNodes myPath = new PathNodes(nodeNumbersInts, regions);
                paths.Add(myPath);
            }
        }
コード例 #9
0
ファイル: Path.cs プロジェクト: chengyimingvb/CYMUni
 /// <summary>
 /// IEnumerator implementation.
 /// </summary>
 /// <returns>The enumerator for the inner collection</returns>
 IEnumerator IEnumerable.GetEnumerator()
 {
     return(PathNodes.GetEnumerator());
 }
コード例 #10
0
ファイル: Path.cs プロジェクト: chengyimingvb/CYMUni
 /// <summary>
 /// IEnumerator implementation.
 /// </summary>
 /// <returns>The enumerator for the inner collection</returns>
 public IEnumerator <IBaseNode> GetEnumerator()
 {
     return(PathNodes.GetEnumerator());
 }
コード例 #11
0
 public void AddNode(INode node)
 {
     PathNodes.Add(node);
     Sum = Sum + node.Value;
 }
コード例 #12
0
ファイル: slovoPathovi.cs プロジェクト: moki74/cirilica
    // Use this for initialization
    void Start()
    {
        PathNodes pn = (PathNodes)Camera.main.GetComponent <PathNodes> ();

        pn.novoSlovo(this.gameObject.name);
    }
    public override void OnInspectorGUI()
    {
        //draws the default inspector
        //DrawDefaultInspector();

        //get the target
        EnemyMovementBehaviour emb = (EnemyMovementBehaviour)target;

        //get size of array in real time
        emb.moveAmount = emb.movePoints.Length;

        EditorGUILayout.LabelField("ENEMY MOVEMENT BEHAVIOUR CUSTOM EDITOR", EditorStyles.boldLabel);

        emb.isLooping = EditorGUILayout.Toggle("Loop this Behaviour", emb.isLooping);
        emb.loopInfinite = EditorGUILayout.Toggle("Loop this Behaviour Forever", emb.loopInfinite);
        emb.moveAndShoot = EditorGUILayout.Toggle("Shoot while moving", emb.moveAndShoot);

        //ARRAY
        SerializedProperty array = serializedObject.FindProperty ("shootingPoints");
        EditorGUI.BeginChangeCheck ();
        EditorGUILayout.PropertyField (array, true);
        if(EditorGUI.EndChangeCheck())
            serializedObject.ApplyModifiedProperties();
        EditorGUIUtility.LookLikeControls();

        if(emb.isLooping == true)
        {
            EditorGUI.indentLevel = 1;
            emb.loopAmt = EditorGUILayout.IntField("Loop Amount", emb.loopAmt);
            EditorGUI.indentLevel = 0;
        }
        emb.shootRate = EditorGUILayout.FloatField("Shoot Rate", emb.shootRate);

        emb.bulletType = (EnemyMovementBehaviour.BulletType)EditorGUILayout.EnumPopup("Bullet Type", emb.bulletType);
        Spaces(1);
        EditorGUILayout.LabelField("Total Translate Elements: " + emb.movePoints.Length, EditorStyles.boldLabel);
        Spaces(1);
        for(int i = 0; i < emb.movePoints.Length; ++i)
        {
            EditorGUI.indentLevel = 1;
            EditorGUILayout.LabelField("Translate Element " + (i + 1).ToString());
            EditorGUI.indentLevel = 2;
            emb.movePoints[i].translateValue = EditorGUILayout.Vector2Field("Value", emb.movePoints[i].translateValue);
            emb.movePoints[i].translateSpeed = EditorGUILayout.FloatField("Speed", emb.movePoints[i].translateSpeed);
            emb.movePoints[i].waitTime = EditorGUILayout.FloatField("Waiting Time", emb.movePoints[i].waitTime);
            emb.movePoints[i].isLerp = EditorGUILayout.Toggle("Acceleration", emb.movePoints[i].isLerp);
            emb.movePoints[i].isShooting = EditorGUILayout.Toggle("Will Shoot", emb.movePoints[i].isShooting);
            if(emb.movePoints[i].isShooting == true)
            {
                EditorGUI.indentLevel = 3;
                emb.movePoints[i].shootAtPlayer = EditorGUILayout.Toggle("Shoot Player", emb.movePoints[i].shootAtPlayer);
            }
            EditorGUI.indentLevel = 1;
            Spaces(2);
        }

        //buttons to handle the translate element list
        if(GUILayout.Button("Add New Translate Element"))
        {
            //increase the size of the array then add the new object at the end
            emb.moveAmount += 1;
            System.Array.Resize(ref emb.movePoints, emb.moveAmount);
            PathNodes p = new PathNodes();
            emb.movePoints[emb.moveAmount - 1] = p;
        }
        else if(GUILayout.Button("Remove Last Element"))
        {
            //delete the final element then decrease the size of the array
            emb.moveAmount -= 1;
            emb.movePoints[emb.moveAmount] = null;
            System.Array.Resize(ref emb.movePoints, emb.moveAmount);
        }

        //sync with original inspector
        if(GUI.changed)
        {
            EditorUtility.SetDirty(emb);
        }
    }