Ejemplo n.º 1
0
 public NodeInfo(int nodeId, string nodeName, ENodeType nodeType, int publishmentSystemId, string contentModelId, int parentId, string parentsPath, int parentsCount, int childrenCount, bool isLastNode, string nodeIndexName, string nodeGroupNameCollection, int taxis, DateTime addDate, string imageUrl, string content, int contentNum, string filePath, string channelFilePathRule, string contentFilePathRule, string linkUrl, ELinkType linkType, int channelTemplateId, int contentTemplateId, string keywords, string description, string extendValues)
 {
     NodeId                  = nodeId;
     NodeName                = nodeName;
     NodeType                = nodeType;
     PublishmentSystemId     = publishmentSystemId;
     _contentModelId         = contentModelId;
     ParentId                = parentId;
     ParentsPath             = parentsPath;
     ParentsCount            = parentsCount;
     ChildrenCount           = childrenCount;
     IsLastNode              = isLastNode;
     NodeIndexName           = nodeIndexName;
     NodeGroupNameCollection = nodeGroupNameCollection;
     Taxis               = taxis;
     AddDate             = addDate;
     ImageUrl            = imageUrl;
     Content             = content;
     ContentNum          = contentNum;
     FilePath            = filePath;
     ChannelFilePathRule = channelFilePathRule;
     ContentFilePathRule = contentFilePathRule;
     LinkUrl             = linkUrl;
     LinkType            = linkType;
     ChannelTemplateId   = channelTemplateId;
     ContentTemplateId   = contentTemplateId;
     Keywords            = keywords;
     Description         = description;
     _extendValues       = extendValues;
 }
Ejemplo n.º 2
0
 // Token: 0x0600255C RID: 9564 RVA: 0x000D8E88 File Offset: 0x000D7288
 public static Transform addNode(Vector3 point, ENodeType type)
 {
     if (type == ENodeType.LOCATION)
     {
         LevelNodes.nodes.Add(new LocationNode(point));
     }
     else if (type == ENodeType.SAFEZONE)
     {
         LevelNodes.nodes.Add(new SafezoneNode(point));
     }
     else if (type == ENodeType.PURCHASE)
     {
         LevelNodes.nodes.Add(new PurchaseNode(point));
     }
     else if (type == ENodeType.ARENA)
     {
         LevelNodes.nodes.Add(new ArenaNode(point));
     }
     else if (type == ENodeType.DEADZONE)
     {
         LevelNodes.nodes.Add(new DeadzoneNode(point));
     }
     else if (type == ENodeType.AIRDROP)
     {
         LevelNodes.nodes.Add(new AirdropNode(point));
     }
     else if (type == ENodeType.EFFECT)
     {
         LevelNodes.nodes.Add(new EffectNode(point));
     }
     return(LevelNodes.nodes[LevelNodes.nodes.Count - 1].model);
 }
Ejemplo n.º 3
0
        public static bool GetProcessedFile(
            WebServiceBaseTimeoutable _Request,
            ENodeType _FileType,
            IBDatabaseServiceInterface _DatabaseService,
            IBFileServiceInterface _FileService,
            string _CadFileStorageBucketName,
            string _ModelID,
            int _RevisionIndex,
            out BWebServiceResponse _SuccessResponse,
            out BWebServiceResponse _FailureResponse,
            Action <string> _ErrorMessageAction = null)
        {
            _SuccessResponse = BWebResponse.InternalError("");

            if (!Controller_AtomicDBOperation.Get().GetClearanceForDBOperation(_Request.InnerProcessor, ModelDBEntry.DBSERVICE_MODELS_TABLE(), _ModelID, _ErrorMessageAction))
            {
                _FailureResponse = BWebResponse.InternalError("Atomic operation control has failed.");
                return(false);
            }

            var bResult = GetProcessedFile_Internal(
                _FileType,
                _DatabaseService,
                _FileService,
                _CadFileStorageBucketName,
                _ModelID,
                _RevisionIndex,
                out _SuccessResponse,
                out _FailureResponse,
                _ErrorMessageAction);

            Controller_AtomicDBOperation.Get().SetClearanceForDBOperationForOthers(_Request.InnerProcessor, ModelDBEntry.DBSERVICE_MODELS_TABLE(), _ModelID, _ErrorMessageAction);

            return(bResult);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 注册Proxy
        /// </summary>
        /// <param name="classType">节点类</param>
        /// <param name="nodeType">节点类型</param>
        /// <param name="type">逻辑对应的Type</param>
        public void Register(string classType, ENodeType nodeType, Type type)
        {
            if (string.IsNullOrEmpty(classType))
            {
                string msg = "CSharpProxyManager.Register() \n classType is null.";
                BehaviorTreeManager.Instance.LogError(msg);
                throw new Exception(msg);
            }

            if (m_ProxyDic.ContainsKey(classType))
            {
                string msg = $"CSharpProxyManager.Register() \n m_ProxyDic already Contain key {classType}.";
                BehaviorTreeManager.Instance.LogError(msg);
                throw new Exception(msg);
            }

            ProxyData proxyData = new ProxyData();

            proxyData.ClassType  = classType;
            proxyData.NodeType   = nodeType;
            proxyData.NeedUpdate = false;

            m_ProxyDic.Add(classType, proxyData);
            m_ProxyTypeDic.Add(classType, type);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///Metodo para Consultar Tipos de Node Comercial
        /// </summary>

        public DataTable ConsultarTypeNode(string snametypenode)
        {
            DataTable dt          = oConn.ejecutarDataTable("UP_WEBSIGE_CONSULTARTYPENODE", snametypenode);
            ENodeType oecnodetype = new ENodeType();

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i <= dt.Rows.Count - 1; i++)
                    {
                        oecnodetype.idNodeComType       = Convert.ToInt32(dt.Rows[i]["idNodeComType"].ToString().Trim());
                        oecnodetype.NodeComTypename     = dt.Rows[i]["NodeComType_name"].ToString().Trim();
                        oecnodetype.NodeComTypeStatus   = Convert.ToBoolean(dt.Rows[i]["NodeComType_Status"].ToString().Trim());
                        oecnodetype.NodeComTypeCreateBy = dt.Rows[i]["NodeComType_CreateBy"].ToString().Trim();
                        oecnodetype.NodeComTypeDateBy   = Convert.ToDateTime(dt.Rows[i]["NodeComType_DateBy"].ToString().Trim());
                        oecnodetype.NodeComTypeModiBy   = dt.Rows[i]["NodeComType_ModiBy"].ToString().Trim();
                        oecnodetype.NodeComTypeDateBy   = Convert.ToDateTime(dt.Rows[i]["NodeComType_DateModiBy"].ToString().Trim());
                    }
                }
                return(dt);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 6
0
        public override ERunStatus Run(Bullet bullet)
        {
            ENodeType ENodeType = Node.NodeType;
            float     value     = (float)(Node.GetValue(this) * Math.PI / 180);

            switch (ENodeType)
            {
            case ENodeType.sequence:
            {
                bullet.Direction = bullet.GetFireData().srcDir + value;
            }
            break;

            case ENodeType.absolute:
            {
                bullet.Direction = value;
            }
            break;

            case ENodeType.relative:
            {
                bullet.Direction = bullet.Direction + value;
            }
            break;

            default:
            {
                bullet.Direction = bullet.GetAimDir() + value;
            }
            break;
            }

            TaskFinished = true;
            return(ERunStatus.End);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     Constructor to define the ID and the node type as well as setting a parent node.
        /// </summary>
        /// <param name="id">The ID of the cell is used as the interest group.</param>
        /// <param name="nodeType">The node type of the cell tree node.</param>
        /// <param name="parent">The parent node of the cell tree node.</param>
        public CellTreeNode(byte id, ENodeType nodeType, CellTreeNode parent)
        {
            this.Id = id;

            this.NodeType = nodeType;

            this.Parent = parent;
        }
Ejemplo n.º 8
0
 public CCatalogNode(string nName, ENodeType nType, long nOffset)
 {
     mName   = nName;
     mType   = nType;
     mOffset = nOffset;
     mParent = null;
     mNodes  = new System.Collections.Generic.List <CCatalogNode>();
 }
Ejemplo n.º 9
0
    /// <summary>
    ///     Constructor to define the ID and the node type as well as setting a parent node.
    /// </summary>
    /// <param name="id">The ID of the cell is used as the interest group.</param>
    /// <param name="nodeType">The node type of the cell tree node.</param>
    /// <param name="parent">The parent node of the cell tree node.</param>
    public CellTreeNode(int id, ENodeType nodeType, CellTreeNode parent)
    {
        Id = id;

        NodeType = nodeType;

        Parent = parent;
    }
Ejemplo n.º 10
0
 public CCatalogNode()
 {
     mName = "";
     mType = ENodeType.Root;
     mOffset = 0;
     mParent = null;
     mNodes = new System.Collections.Generic.List<CCatalogNode>();
 }
Ejemplo n.º 11
0
 public CCatalogNode(string nName, ENodeType nType, long nOffset)
 {
     mName = nName;
     mType = nType;
     mOffset = nOffset;
     mParent = null;
     mNodes = new System.Collections.Generic.List<CCatalogNode>();
 }
Ejemplo n.º 12
0
 public CCatalogNode()
 {
     mName   = "";
     mType   = ENodeType.Root;
     mOffset = 0;
     mParent = null;
     mNodes  = new System.Collections.Generic.List <CCatalogNode>();
 }
Ejemplo n.º 13
0
        public FSMNodeEditor(FSMGraphEditor root, ENodeType nodeType = ENodeType.Node)
        {
            nodeName = "NODE EMPTY";
            nodeRect = new Rect(100f, 100f, m_WidthRect, m_HeightRect);

            rootGraph       = root;
            this.IsNodeType = nodeType;
            conditionLines  = new List <FSMConditionLineEditor> ();
        }
Ejemplo n.º 14
0
        public FSMNodeEditor(string name, float x, float y, FSMGraphEditor root, ENodeType nodeType = ENodeType.Node)
        {
            nodeName = name;
            nodeRect = new Rect(x, y, m_WidthRect, m_HeightRect);

            rootGraph       = root;
            this.IsNodeType = nodeType;
            conditionLines  = new List <FSMConditionLineEditor> ();
        }
Ejemplo n.º 15
0
 public CCatalogNode(CDescriptorBlock descriptorBlock, string nName, ENodeType nType)
 {
     mDescriptorBlock = descriptorBlock;
     mName            = nName;
     mType            = nType;
     mOffset          = descriptorBlock.StartPosition;
     mParent          = null;
     mNodes           = new System.Collections.Generic.List <CCatalogNode>();
 }
Ejemplo n.º 16
0
        /// <summary>
        ///Metodo para Actualizar Tipos de Node Comercial
        /// </summary>


        public ENodeType ActualizarTypeNode(int iidtypenode, string snametypenode, bool bstatustypenode, string sModiBynodetype, DateTime tDateModiBynodetype)

        {
            DNodeType odanodetype = new DNodeType();
            ENodeType oeanodetype = odanodetype.ActualizarTypeNode(iidtypenode, snametypenode, bstatustypenode, sModiBynodetype, tDateModiBynodetype);

            odanodetype = null;
            return(oeanodetype);
        }
Ejemplo n.º 17
0
 public void Convert(INode node)
 {
     Id        = node.Id;
     RouteId   = node.RouteId;
     Position  = node.Position;
     Direction = node.Direction;
     NodeType  = node.NodeType;
     Floor     = node.Floor;
 }
Ejemplo n.º 18
0
        /// <summary>
        ///Metodo para Registrar Tipos de Node Comercial
        /// </summary>


        public ENodeType RegistrarTypeNode(string snametypenode, bool bstatustypenode, string sCreatebytypenode,
                                           DateTime tDateBynodetype, string sModiBynodetype, DateTime tDateModiBynodetype)
        {
            DNodeType odnodetype = new DNodeType();
            ENodeType oenodetype = odnodetype.RegistrarTypeNode(snametypenode, bstatustypenode, sCreatebytypenode,
                                                                tDateBynodetype, sModiBynodetype, tDateModiBynodetype);

            odnodetype = null;
            return(oenodetype);
        }
Ejemplo n.º 19
0
 public Node(ProviderKey provider, TreeNode root, Node parentNode, NodeData value, ENodeType nodeType, INodePipeline pipeline = null)
 {
     Provider        = provider;
     this.root       = root;
     this.parentNode = parentNode;
     this.value      = value;
     this.nodeType   = nodeType;
     this.pipeline   = pipeline;
     Key             = this.GetTreeKey();
     Topic           = this.GetTopic(parentNode);
 }
Ejemplo n.º 20
0
 public Node(int nodeId, int leftNodeId, int rightNodeId, string nodeName,
             ENodeType nodeType = ENodeType.BaseNode, EMathOperation mathOperation = EMathOperation.None,
             float nodeNum      = 0f)
 {
     this.nodeId        = nodeId;
     this.leftNodeId    = leftNodeId;
     this.rightNodeId   = rightNodeId;
     this.nodeName      = nodeName;
     this.nodeType      = nodeType;
     this.nodeNum       = nodeNum;
     this.mathOperation = mathOperation;
 }
Ejemplo n.º 21
0
 public static bool Equals(ENodeType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 22
0
        /// <summary>
        ///Metodo para Actualizar Tipos de Node Comercial
        /// </summary>


        public ENodeType ActualizarTypeNode(int iidtypenode, string snametypenode, bool bstatustypenode, string sModiBynodetype, DateTime tDateModiBynodetype)
        {
            DataTable dt          = oConn.ejecutarDataTable("UP_WEBSIGE_ACTUALIZARTYPENODE", iidtypenode, snametypenode, bstatustypenode, sModiBynodetype, tDateModiBynodetype);
            ENodeType oeanodetype = new ENodeType();

            oeanodetype.idNodeComType         = iidtypenode;
            oeanodetype.NodeComTypename       = snametypenode;
            oeanodetype.NodeComTypeStatus     = bstatustypenode;
            oeanodetype.NodeComTypeModiBy     = sModiBynodetype;
            oeanodetype.NodeComTypeDateModiBy = tDateModiBynodetype;
            return(oeanodetype);
        }
Ejemplo n.º 23
0
        private BobFsNode NewNode(string name, ENodeType type)
        {
            if (!IsDirectory)
            {
                throw new InvalidOperationException("Current node is not a directory.");
            }

            // Get free inum
            // TODO: Can be optimized
            // TODO: Implement caching
            int freeInum = -1;

            _bobFs.Source.ReadAll(BobFs.BlockSize * 2, _tmpBuffer, 0, BobFs.BlockSize);
            BitArray inodeBitmap = new BitArray(_tmpBuffer);

            for (int index = 0; index < BobFs.BlockSize * 8 && freeInum == -1; index++)
            {
                if (!inodeBitmap[index])
                {
                    freeInum = index;
                }
            }
            if (freeInum == -1)
            {
                throw new Exception("No free Inode.");
            }
            inodeBitmap[freeInum] = true;
            inodeBitmap.CopyTo(_tmpBuffer, 0);
            _bobFs.Source.WriteAll(BobFs.BlockSize * 2, _tmpBuffer, 0, BobFs.BlockSize);

            // Add to directory
            DirEntry newDirEntry = new DirEntry();

            newDirEntry.Inum = (uint)freeInum;
            newDirEntry.Name = name;
            int bytesWritten = newDirEntry.WriteTo(this, (int)Size);

            if (bytesWritten < 0)
            {
                throw new Exception("Current directory is full.");
            }

            // Create inode at inum
            BobFsNode newInode = new BobFsNode(_bobFs, (uint)freeInum);

            newInode.Type     = type;
            newInode.NumLinks = 1;
            newInode.Size     = 0;
            newInode.Commit();

            return(newInode);
        }
Ejemplo n.º 24
0
    private void SetNodeType(string nodeTypeString)
    {
        ENodeType nodeType = (ENodeType)Enum.Parse(typeof(ENodeType), nodeTypeString);
        var       nodes    = GetAllSelected();

        for (int i = 0; i < nodes.Count; i++)
        {
            if (!ReferenceEquals(null, nodes[i]))
            {
                nodes[i].NodeType = nodeType;
            }
        }
    }
Ejemplo n.º 25
0
        public static bool GetProcessedFileNode(
            WebServiceBaseTimeoutable _Request,
            ENodeType _FileType,
            IBDatabaseServiceInterface _DatabaseService,
            IBFileServiceInterface _FileService,
            string _CadFileStorageBucketName,
            string _ModelID,
            int _RevisionIndex,
            bool _bRootNodeRequested, ulong _NodeID,
            out BWebServiceResponse _SuccessResponse,
            out BWebServiceResponse _FailureResponse,
            Action <string> _ErrorMessageAction = null)
        {
            _SuccessResponse = BWebResponse.InternalError("");

            uint StartIndex = 0, Size = 0;

            if (!_bRootNodeRequested)
            {
                Convert.UniqueIDToStartIndexAndSize(_NodeID, out StartIndex, out Size);
                if (StartIndex == 0 || Size == 0)
                {
                    _FailureResponse = BWebResponse.BadRequest("Invalid Node ID.");
                    return(false);
                }
            }

            if (!Controller_AtomicDBOperation.Get().GetClearanceForDBOperation(_Request.InnerProcessor, ModelDBEntry.DBSERVICE_MODELS_TABLE(), _ModelID, _ErrorMessageAction))
            {
                _FailureResponse = BWebResponse.InternalError("Atomic operation control has failed.");
                return(false);
            }

            var bResult = GetProcessedFileNode_Internal(
                _FileType,
                _DatabaseService,
                _FileService,
                _CadFileStorageBucketName,
                _ModelID,
                _RevisionIndex,
                _bRootNodeRequested,
                StartIndex,
                Size,
                out _SuccessResponse,
                out _FailureResponse,
                _ErrorMessageAction);

            Controller_AtomicDBOperation.Get().SetClearanceForDBOperationForOthers(_Request.InnerProcessor, ModelDBEntry.DBSERVICE_MODELS_TABLE(), _ModelID, _ErrorMessageAction);

            return(bResult);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// this sets up the task to be run.
        /// </summary>
        /// <param name="bullet">Bullet.</param>
        protected override void SetupTask(Bullet bullet)
        {
            //set the length of time to run this dude
            Duration = Node.GetChildValue(ENodeName.term, this, bullet);

            //check for divide by 0
            if (0.0f == Duration)
            {
                Duration = 1.0f;
            }

            NodeSpeed  = Node.GetChildValue(ENodeName.speed, this, bullet);
            ChangeType = Node.GetChild(ENodeName.speed).NodeType;
        }
Ejemplo n.º 27
0
        public static ENodeType GetEnumType(string typeStr)
        {
            ENodeType retval = ENodeType.BackgroundNormalNode;

            if (Equals(ENodeType.BackgroundPublishNode, typeStr))
            {
                retval = ENodeType.BackgroundPublishNode;
            }
            else if (Equals(ENodeType.BackgroundNormalNode, typeStr))
            {
                retval = ENodeType.BackgroundNormalNode;
            }

            return(retval);
        }
Ejemplo n.º 28
0
 public static string GetValue(ENodeType type)
 {
     if (type == ENodeType.BackgroundPublishNode)
     {
         return("BackgroundPublishNode");
     }
     else if (type == ENodeType.BackgroundNormalNode)
     {
         return("BackgroundNormalNode");
     }
     else
     {
         throw new Exception();
     }
 }
Ejemplo n.º 29
0
        /// <summary>
        ///Metodo para Registrar Tipos de Node Comercial
        /// </summary>


        public ENodeType RegistrarTypeNode(string snametypenode, bool bstatustypenode, string sCreatebytypenode,
                                           DateTime tDateBynodetype, string sModiBynodetype, DateTime tDateModiBynodetype)
        {
            DataTable dt = oConn.ejecutarDataTable("UP_WEBSIGE_REGISTERTYPENODE", snametypenode, bstatustypenode, sCreatebytypenode,
                                                   tDateBynodetype, sModiBynodetype, tDateModiBynodetype);
            ENodeType oenodetype = new ENodeType();

            oenodetype.NodeComTypename       = snametypenode;
            oenodetype.NodeComTypeStatus     = bstatustypenode;
            oenodetype.NodeComTypeCreateBy   = sCreatebytypenode;
            oenodetype.NodeComTypeDateBy     = tDateBynodetype;
            oenodetype.NodeComTypeModiBy     = sModiBynodetype;
            oenodetype.NodeComTypeDateModiBy = tDateModiBynodetype;
            return(oenodetype);
        }
Ejemplo n.º 30
0
        public XStreamReader(ENodeType _FileType, Stream _InnerStream, Action <uint> _OnFileSDKVersionRead, Action <Node> _OnNodeRead_TS, EDeflateCompression _Compression)
        {
            FileType             = _FileType;
            OnFileSDKVersionRead = _OnFileSDKVersionRead;
            OnNodeRead_TS        = _OnNodeRead_TS;
            InnerStream          = _InnerStream;

            Compression = _Compression;
            if (Compression == EDeflateCompression.Compress)
            {
                DecompressionStream = new GZipStream(InnerStream, CompressionMode.Decompress);
            }

            ProcessThread = new Thread(Process_Runnable);
            ProcessThread.Start();
        }
Ejemplo n.º 31
0
        private void ReadNode(System.IO.BinaryReader file)
        {
            // Read node info
            mType   = (ENodeType)file.ReadInt32();
            mName   = file.ReadString();
            mOffset = file.ReadInt64();
            int count = file.ReadInt32();

            // Recursively read child nodes
            for (int i = 0; i < count; i++)
            {
                CCatalogNode node = new CCatalogNode();
                mNodes.Add(node);
                node.ReadNode(file);
            }
        }
Ejemplo n.º 32
0
 public Node(Type type)
 {
     if (type.IsClass)
     {
         NodeType = ENodeType.NodeClass;
     }
     else if (type.IsInterface)
     {
         NodeType = ENodeType.NodeInterface;
     }
     else
     {
         NodeType = ENodeType.NodeUnknown;
     }
     Name       = type.ToString();
     TypeStruct = type;
     SubNodes   = new Dictionary <string, Node>();
 }
 /// <summary>
 /// Constructor of the class, that should be used
 /// </summary>
 /// <param name="name">name of the node</param>
 /// <param name="type">type of the node</param>
 /// <param name="ident">ICE identifier of the box factory</param>
 public NewBoxNode(string name, ENodeType type, string ident)
     : base(name)
 {
     nodeType = type;
     identifier = ident;
 }
Ejemplo n.º 34
0
 public void Read(hsStream s)
 {
     pnVaultNodeFields f = (pnVaultNodeFields)s.ReadULong();
     for (ulong bit = 1; bit != 0 && bit <= (ulong)f; bit <<= 1) {
         switch (f & (pnVaultNodeFields)bit) {
             case pnVaultNodeFields.Blob_1:
                 fBlob[0] = s.ReadBytes(s.ReadInt());
                 break;
             case pnVaultNodeFields.Blob_2:
                 fBlob[1] = s.ReadBytes(s.ReadInt());
                 break;
             case pnVaultNodeFields.CreateAgeName:
                 fCreateAgeName = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.CreateAgeUuid:
                 fCreateAgeGuid = pnHelpers.ReadUuid(s);
                 break;
             case pnVaultNodeFields.CreateTime:
                 fCreateTime = plUnifiedTime.Epoch.AddSeconds((double)s.ReadInt());
                 break;
             case pnVaultNodeFields.CreatorIdx:
                 fCreatorID = s.ReadUInt();
                 break;
             case pnVaultNodeFields.CreatorUuid:
                 fCreatorGuid = pnHelpers.ReadUuid(s);
                 break;
             case pnVaultNodeFields.Int32_1:
                 fInt32[0] = s.ReadInt();
                 break;
             case pnVaultNodeFields.Int32_2:
                 fInt32[1] = s.ReadInt();
                 break;
             case pnVaultNodeFields.Int32_3:
                 fInt32[2] = s.ReadInt();
                 break;
             case pnVaultNodeFields.Int32_4:
                 fInt32[3] = s.ReadInt();
                 break;
             case pnVaultNodeFields.IString64_1:
                 fIString64[0] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.IString64_2:
                 fIString64[1] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.ModifyTime:
                 fModifyTime = plUnifiedTime.Epoch.AddSeconds((double)s.ReadInt());
                 break;
             case pnVaultNodeFields.NodeIdx:
                 fNodeID = s.ReadUInt();
                 break;
             case pnVaultNodeFields.NodeType:
                 fNodeType = (ENodeType)s.ReadUInt();
                 break;
             case pnVaultNodeFields.String64_1:
                 fString64[0] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.String64_2:
                 fString64[1] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.String64_3:
                 fString64[2] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.String64_4:
                 fString64[3] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.String64_5:
                 fString64[4] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.String64_6:
                 fString64[5] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.Text_1:
                 fText[0] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.Text_2:
                 fText[1] = pnHelpers.ReadString(s);
                 break;
             case pnVaultNodeFields.UInt32_1:
                 fUInt32[0] = s.ReadUInt();
                 break;
             case pnVaultNodeFields.UInt32_2:
                 fUInt32[1] = s.ReadUInt();
                 break;
             case pnVaultNodeFields.UInt32_3:
                 fUInt32[2] = s.ReadUInt();
                 break;
             case pnVaultNodeFields.UInt32_4:
                 fUInt32[3] = s.ReadUInt();
                 break;
             case pnVaultNodeFields.Uuid_1:
                 fGuid[0] = pnHelpers.ReadUuid(s);
                 break;
             case pnVaultNodeFields.Uuid_2:
                 fGuid[1] = pnHelpers.ReadUuid(s);
                 break;
             case pnVaultNodeFields.Uuid_3:
                 fGuid[2] = pnHelpers.ReadUuid(s);
                 break;
             case pnVaultNodeFields.Uuid_4:
                 fGuid[3] = pnHelpers.ReadUuid(s);
                 break;
         }
     }
 }
Ejemplo n.º 35
0
 public pnVaultNode(ENodeType type)
 {
     fNodeType = type;
 }
Ejemplo n.º 36
0
 public VaultNode(ENodeType type, DateTime createTime, DateTime modifyTime)
 {
     fNodeType = type;
     fCreateTime = createTime;
     fModifyTime = modifyTime;
 }
Ejemplo n.º 37
0
        public override ERunStatus Run(Bullet bullet)
        {
            if (InitialRun)
            {
                InitialRun = false;

                //Get the amount to change direction from the nodes
                float value = (float)(Node.GetChildValue(ENodeName.direction, this) * Math.PI / 180); //also make sure to convert to radians

                //How do we want to change direction?
                ChangeType = Node.GetChild(ENodeName.direction).NodeType;
                switch (ChangeType)
                {
                    case ENodeType.sequence:
                    {
                        //We are going to add this amount to the direction every frame
                        DirectionChange = value;
                    }
                    break;

                    case ENodeType.absolute:
                    {
                        //We are going to go in the direction we are given, regardless of where we are pointing right now
                        DirectionChange = (float)(value - bullet.Direction);
                    }
                    break;

                    case ENodeType.relative:
                    {
                        //The direction change will be relative to our current direction
                        DirectionChange = (float)(value);
                    }
                    break;

                    default:
                    {
                        //the direction change is to aim at the enemy
                        DirectionChange = ((bullet.GetAimDir() + value) - bullet.Direction);
                    }
                    break;
                }

                //keep the direction between 0 and 360
                if (DirectionChange > Math.PI)
                {
                    DirectionChange -= 2 * (float)Math.PI;
                }
                else if (DirectionChange < -Math.PI)
                {
                    DirectionChange += 2 * (float)Math.PI;
                }

                //The sequence type of change direction is unaffected by the duration
                if (ChangeType != ENodeType.sequence)
                {
                    //Divide by the duration so we ease into the direction change
                    DirectionChange /= (float)Duration;
                }
            }

            //change the direction of the bullet by the correct amount
            bullet.Direction += DirectionChange;

            //decrement the amount if time left to run and return End when this task is finished
            Duration--;
            if (Duration <= 0)
            {
                TaskFinished = true;
                return ERunStatus.End;
            }
            else
            {
                //since this task isn't finished, run it again next time
                return ERunStatus.Continue;
            }
        }
Ejemplo n.º 38
0
        /// <summary>
        /// this sets up the task to be run.
        /// </summary>
        /// <param name="bullet">Bullet.</param>
        protected override void SetupTask(Bullet bullet)
        {
            RunDelta = 0;

            //set the time length to run this dude
            Duration = Node.GetChildValue(ENodeName.term, this, bullet);

            //check for divide by 0
            if (0.0f == Duration)
            {
                Duration = 1.0f;
            }

            //Get the amount to change direction from the nodes
            DirectionNode dirNode = Node.GetChild(ENodeName.direction) as DirectionNode;
            NodeDirection = dirNode.GetValue(this, bullet) * (float)Math.PI / 180.0f; //also make sure to convert to radians

            //How do we want to change direction?
            ChangeType = dirNode.NodeType;
        }
Ejemplo n.º 39
0
        private void ReadNode(System.IO.BinaryReader file)
        {
            // Read node info
            mType = (ENodeType)file.ReadInt32();
            mName = file.ReadString();
            mOffset = file.ReadInt64();
            int count = file.ReadInt32();

            // Recursively read child nodes
            for (int i = 0; i < count; i++)
            {
                CCatalogNode node = new CCatalogNode();
                mNodes.Add(node);
                node.ReadNode(file);
            }
        }
Ejemplo n.º 40
0
        /// <summary>
        /// this sets up the task to be run.
        /// </summary>
        /// <param name="bullet">Bullet.</param>
        protected override void SetupTask(Bullet bullet)
        {
            //set the length of time to run this dude
            Duration = Node.GetChildValue(ENodeName.term, this, bullet);

            //check for divide by 0
            if (0.0f == Duration)
            {
                Duration = 1.0f;
            }

            NodeSpeed = Node.GetChildValue(ENodeName.speed, this, bullet);
            ChangeType = Node.GetChild(ENodeName.speed).NodeType;
        }
Ejemplo n.º 41
0
        public void Read(UruStream s)
        {
            ulong bit = 1;
            Fields f = (Fields)s.ReadULong();
            while (bit != 0 && bit <= (ulong)f) {
                switch (f & (Fields)bit) {
                    case Fields.kBlob_1:
                        fBlob[0] = s.ReadBytes(s.ReadInt());
                        break;
                    case Fields.kBlob_2:
                        fBlob[1] = s.ReadBytes(s.ReadInt());
                        break;
                    case Fields.kCreateAgeName:
                        fCreateAgeName = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kCreateAgeUuid:
                        fCreateAgeUuid = new Guid(s.ReadBytes(16));
                        break;
                    case Fields.kCreateTime:
                        fCreateTime = ToDateTime(s.ReadUInt());
                        break;
                    case Fields.kCreatorIdx:
                        fCreatorIdx = s.ReadUInt();
                        break;
                    case Fields.kCreatorUuid:
                        fCreatorUuid = new Guid(s.ReadBytes(16));
                        break;
                    case Fields.kInt32_1:
                        fInt32[0] = s.ReadInt();
                        break;
                    case Fields.kInt32_2:
                        fInt32[1] = s.ReadInt();
                        break;
                    case Fields.kInt32_3:
                        fInt32[2] = s.ReadInt();
                        break;
                    case Fields.kInt32_4:
                        fInt32[3] = s.ReadInt();
                        break;
                    case Fields.kIString64_1:
                        fIString64[0] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kIString64_2:
                        fIString64[1] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kModifyTime:
                        fModifyTime = ToDateTime(s.ReadUInt());
                        break;
                    case Fields.kNodeIdx:
                        fIdx = s.ReadUInt();
                        break;
                    case Fields.kNodeType:
                        fNodeType = (ENodeType)s.ReadUInt();
                        break;
                    case Fields.kString64_1:
                        fString64[0] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kString64_2:
                        fString64[1] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kString64_3:
                        fString64[2] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kString64_4:
                        fString64[3] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kString64_5:
                        fString64[4] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kString64_6:
                        fString64[5] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kText_1:
                        fText[0] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kText_2:
                        fText[0] = s.ReadUnicodeStringV32();
                        break;
                    case Fields.kUInt32_1:
                        fUInt32[0] = s.ReadUInt();
                        break;
                    case Fields.kUInt32_2:
                        fUInt32[1] = s.ReadUInt();
                        break;
                    case Fields.kUInt32_3:
                        fUInt32[2] = s.ReadUInt();
                        break;
                    case Fields.kUInt32_4:
                        fUInt32[3] = s.ReadUInt();
                        break;
                    case Fields.kUuid_1:
                        fUuid[0] = new Guid(s.ReadBytes(16));
                        break;
                    case Fields.kUuid_2:
                        fUuid[1] = new Guid(s.ReadBytes(16));
                        break;
                    case Fields.kUuid_3:
                        fUuid[2] = new Guid(s.ReadBytes(16));
                        break;
                    case Fields.kUuid_4:
                        fUuid[3] = new Guid(s.ReadBytes(16));
                        break;
                }

                bit <<= 1;
            }
        }
Ejemplo n.º 42
0
 protected VaultFolderNode(ENodeType type)
     : base(type)
 {
 }
Ejemplo n.º 43
0
 public VaultNodeAccess(ENodeType type)
 {
     fBase = new VaultNode(type);
 }