Ejemplo n.º 1
0
    public bool Init()
    {
        if (ms_fileSystem == null)
        {
            ms_fileSystem = new BehaviacFileManager();
        }

        {
            //< write log file
            behaviac.Config.IsLogging = true;
            //behaviac.Config.IsSocketing = false;

            behaviac.Workspace.Instance.FilePath   = this.WorkspaceExportPath;
            behaviac.Workspace.Instance.FileFormat = behaviac.Workspace.EFileFormat.EFF_xml;

            //register names
            behaviac.Agent.RegisterInstanceName <GameLevelCommon>("GameLevel");
            behaviac.Workspace.Instance.ExportMetas("behaviac/workspace/xmlmeta/BattleCityMeta.xml");

            behaviac.Debug.Log("Behaviac meta data export over.");
            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return(true);
    }
Ejemplo n.º 2
0
	public bool Init ()
    {
        if (ms_fileSystem == null)
        {
            ms_fileSystem = new BehaviacFileManager();
        }

        {
            //< write log file
            behaviac.Config.IsLogging = true;
            //behaviac.Config.IsSocketing = false;

            behaviac.Workspace.Instance.FilePath = this.WorkspaceExportPath;
            behaviac.Workspace.Instance.FileFormat = behaviac.Workspace.EFileFormat.EFF_xml;

            //register names
            behaviac.Agent.RegisterInstanceName<GameLevelCommon>("GameLevel");
            behaviac.Workspace.Instance.ExportMetas("behaviac/workspace/xmlmeta/BattleCityMeta.xml");

            behaviac.Debug.Log("Behaviac meta data export over.");
            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return true;
    }
Ejemplo n.º 3
0
    public bool Init()
    {
        if (ms_fileSystem == null)
        {
            ms_fileSystem = new BehaviacFileManager();
        }

        bool bInit = false;

        if (this.FileFormat != ms_fileFormat)
        {
            ms_fileFormat = this.FileFormat;
            bInit         = true;
        }

        //only init it when the file format changed at the init is slow
        if (bInit)
        {
            if (ms_bInit)
            {
                behaviac.Workspace.Instance.Cleanup();

                behaviac.LogManager.Close();
            }

            ms_bInit = true;

            //< write log file
            behaviac.Config.IsLogging   = true;
            behaviac.Config.IsSocketing = false;

            behaviac.Workspace.Instance.FilePath   = this.FilePath;
            behaviac.Workspace.Instance.FileFormat = this.FileFormat;

            //register names
            behaviac.Agent.RegisterInstanceName <ParTestRegNameAgent>();

            behaviac.Workspace.Instance.ExportMetas("behaviac/workspace/xmlmeta/unittestmeta.xml");

            behaviac.Debug.Log("Behaviac meta data export over.");

            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return(true);
    }
Ejemplo n.º 4
0
    public bool init()
    {
        if (!m_bIsInited)
        {
            m_bIsInited = true;

            if (fileSystem == null)
            {
                fileSystem = new BehaviacFileManager();
            }

            int formatID = getTestFormat();
            behaviac.Workspace.EFileFormat btFormat = (behaviac.Workspace.EFileFormat)formatID;

            string btExportPath = exportPath;
            behaviac.Workspace.EFileFormat btFileFormat = btFormat;
            behaviac.Workspace.SetWorkspaceSettings(btExportPath, btFileFormat);
            //register names
            behaviac.Agent.RegisterName <ParTestRegNameAgent>();

            string metaExportPath = workspacePath + "/xmlmeta/UnitTestMeta.xml";
            behaviac.Workspace.ExportMetas(metaExportPath);

            //TODO
            behaviac.IVariable.Register <TNS.ST.PER.WRK.kEmployee>("TNS.ST.PER.WRK.kEmployee");
            behaviac.IVariable.Register <TNS.NE.NAT.eColor>("TNS.NE.NAT.eColor");
            behaviac.IVariable.Register <ParTestAgentBase>("ParTestAgentBase");
            behaviac.IVariable.Register <TNS.ST.PER.WRK.kEmployee>("kEmployee");
            behaviac.IVariable.Register <TNS.NE.NAT.eColor>("eColor");

            behaviac.Debug.Log("Behaviac meta data export over.");

            behaviac.Workspace.RespondToBreakHandler += RespondToBreak;

            //< write log file
            //behaviac.Config.IsLogging = false;
            //behaviac.Config.IsSocketing = false;

            bool isBlockSocket = false;
            behaviac.SocketUtils.SetupConnection(isBlockSocket);
            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return(true);
    }
Ejemplo n.º 5
0
    public bool init()
    {
        if (!m_bIsInited)
        {
            m_bIsInited = true;

            if (fileSystem == null)
            {
                fileSystem = new BehaviacFileManager();
            }
            //behaviac.Workspace.RegisterBehaviorNode ();

            //register agents
            //behaviac.Workspace.RegisterMetas ();
            string btExportPath = GameLevelCommon.WorkspaceExportedPath;
            behaviac.Workspace.EFileFormat btFileFormat = behaviac.Workspace.EFileFormat.EFF_xml;
            behaviac.Workspace.SetWorkspaceSettings(btExportPath, btFileFormat);
            //register names
            behaviac.Agent.RegisterName <GameLevelCommon> ("GameLevel");

            string metaExportPath = GameLevelCommon.WorkspacePath + "/xmlmeta/BattleCityMeta.xml";
            behaviac.Workspace.ExportMetas(metaExportPath);
            behaviac.Debug.Log("Behaviac meta data export over.");

            //behaviac.Workspace.RespondToBreakHandler += RespondToBreak;

            //< write log file
            //behaviac.Config.IsLogging = false;
            //behaviac.Config.IsSocketing = false;

            bool isBlockSocket = false;
            behaviac.SocketUtils.SetupConnection(isBlockSocket);
            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return(true);
    }
Ejemplo n.º 6
0
    public bool init()
    {
        if (!m_bIsInited)
        {
            m_bIsInited = true;

            if(fileSystem == null)
            {
                fileSystem = new BehaviacFileManager ();
            }

            int formatID = getTestFormat();
            behaviac.Workspace.EFileFormat btFormat = (behaviac.Workspace.EFileFormat)formatID;

            string btExportPath = exportPath;
            behaviac.Workspace.EFileFormat btFileFormat = btFormat;
            behaviac.Workspace.SetWorkspaceSettings (btExportPath, btFileFormat);
            //register names
            behaviac.Agent.RegisterName<ParTestRegNameAgent>();

            string metaExportPath = workspacePath + "/xmlmeta/UnitTestMeta.xml";
            behaviac.Workspace.ExportMetas(metaExportPath);
            behaviac.Debug.Log ("Behaviac meta data export over.");

            behaviac.Workspace.RespondToBreakHandler += RespondToBreak;

            //< write log file
            //behaviac.Config.IsLogging = false;
            //behaviac.Config.IsSocketing = false;

            bool isBlockSocket = false;
            behaviac.SocketUtils.SetupConnection (isBlockSocket);
            behaviac.Agent.SetIdMask (0xffffffff);
        }

        return true;
    }
Ejemplo n.º 7
0
    public bool Init()
    {
        if (ms_fileSystem == null)
        {
            ms_fileSystem = new BehaviacFileManager();
        }

        bool bInit = false;

        if (this.FileFormat != ms_fileFormat)
        {
            ms_fileFormat = this.FileFormat;
            bInit = true;
        }

        //only init it when the file format changed at the init is slow
        if (bInit)
        {
            if (ms_bInit)
            {
                behaviac.Workspace.Instance.Cleanup();

                behaviac.LogManager.Instance.Close();
            }

            ms_bInit = true;

            //< write log file
            behaviac.Config.IsLogging = true;
            behaviac.Config.IsSocketing = false;

            behaviac.Workspace.Instance.FilePath = this.FilePath;
            behaviac.Workspace.Instance.FileFormat = this.FileFormat;

            //register names
            behaviac.Agent.RegisterInstanceName<ParTestRegNameAgent>();

            behaviac.Workspace.Instance.ExportMetas("behaviac/workspace/xmlmeta/unittestmeta.xml");

            behaviac.Debug.Log("Behaviac meta data export over.");

            behaviac.Agent.SetIdMask(0xffffffff);
        }

        return true;
    }