예제 #1
0
        protected void addBackground(InitTable config)
        {
            SoundDescriptor desc = new SoundDescriptor();

            desc.filename  = config.findData <string>("sound");
            desc.is3d      = false;
            desc.isLooping = true;
            desc.priority  = Priority.BACKGROUND_FX;
            Sound snd = new Sound(desc);

            Background bg = new Background(this);

            bg.sound = snd;

            Random rand = new Random();

            bg.pitch.minVal     = config.findDataOr <float>("pitch.minVal", 0.8f);
            bg.pitch.maxVal     = config.findDataOr <float>("pitch.maxVal", 1.2f);
            bg.pitch.currentVal = rand.randomInRange(bg.pitch.minVal, bg.pitch.maxTime);
            bg.pitch.minTime    = config.findDataOr <float>("pitch.minTime", 1.0f);
            bg.pitch.maxTime    = config.findDataOr <float>("pitch.maxTime", 5.0f);
            bg.pitch.reset();

            bg.volume.minVal     = config.findDataOr <float>("volume.minVal", 0.8f);
            bg.volume.maxVal     = config.findDataOr <float>("volume.maxVal", 1.2f);
            bg.volume.currentVal = rand.randomInRange(bg.volume.minVal, bg.volume.maxTime);
            bg.volume.minTime    = config.findDataOr <float>("volume.minTime", 1.0f);
            bg.volume.maxTime    = config.findDataOr <float>("volume.maxTime", 5.0f);
            bg.volume.reset();

            myBackgrounds.Add(bg);
        }
예제 #2
0
        protected void addPeriodic(InitTable config)
        {
            SoundDescriptor desc = new SoundDescriptor();

            desc.filename  = config.findData <string>("sound");
            desc.is3d      = true;
            desc.isLooping = false;
            desc.priority  = Priority.BACKGROUND_FX;

            Sound snd = new Sound(desc);

            snd.relativePosition = true;

            Periodic pr = new Periodic(this);

            pr.sound = snd;

            Random rand = new Random();

            pr.minPitch = config.findDataOr <float>("pitch.min", 0.8f);
            pr.maxPitch = config.findDataOr <float>("pitch.max", 1.2f);
            pr.minDelay = config.findDataOr <float>("delay.min", 1.0f);
            pr.maxDelay = config.findDataOr <float>("delay.min", 5.0f);
            pr.maxRange = config.findDataOr <Vector3>("maxRange", new Vector3(20, 20, 20));

            pr.nextTime = rand.randomInRange(pr.minDelay, pr.maxDelay);

            myPeriodics.Add(pr);
        }
예제 #3
0
        public static void init(InitTable initializer = null)
        {
            if (initializer != null)
            {
                //configure any render specific stuff here
            }

            Info.print("------------------RENDERER----------------");

            string version = GL.GetString(StringName.Version);
            int    major   = System.Convert.ToInt32(version[0].ToString());
            int    minor   = System.Convert.ToInt32(version[2].ToString());

            Info.print("Found OpenGL Version: {0}.{1}", major, minor);
            Info.print("Renderer: {0}", GL.GetString(StringName.Renderer));
            Info.print("Vendor: {0}", GL.GetString(StringName.Vendor));
            Info.print("Version: {0}", GL.GetString(StringName.Version));
            Info.print("Shader Language Version: {0}", GL.GetString(StringName.ShadingLanguageVersion));
            Debug.print("Extensions:");
            foreach (String s in device.extensions())
            {
                Debug.print(s);
            }

            Info.print("------------------RENDERER----------------");
        }
예제 #4
0
        public Table(InitTable initTable = null)
        {
            _delimetersCounter      = 0;
            _multiDelimetersCounter = 301;
            _coreWordsCounter       = 401;
            _constantCounter        = 501;
            _identifiersCounter     = 1001;

            Constants       = new Dictionary <string, int>();
            Identifiers     = new Dictionary <string, int>();
            Delimeters      = new Dictionary <char, int>();
            MultiDelimeters = new Dictionary <string, int>();
            CoreWords       = new Dictionary <string, int>();

            if (initTable != null)
            {
                CommentOpenSymbol     = initTable.CommentOpenSymbol == default(char) ? '(' : initTable.CommentOpenSymbol;
                CommentAdditionSymbol = initTable.CommentAdditionSymbol == default(char) ? '*' : initTable.CommentAdditionSymbol;
                CommentCloseSymbol    = initTable.CommentCloseSymbol == default(char) ? ')' : initTable.CommentCloseSymbol;

                if (initTable.Delimeters != null)
                {
                    foreach (var delimeter in initTable.Delimeters)
                    {
                        AddDelimeter(delimeter);
                    }
                }
                if (initTable.MultiDelimeters != null)
                {
                    foreach (var multiDelimeter in initTable.MultiDelimeters)
                    {
                        AddMultiDelimeter(multiDelimeter);
                    }
                }
                if (initTable.CoreWords != null)
                {
                    foreach (var coreWord in initTable.CoreWords)
                    {
                        AddCoreWord(coreWord);
                    }
                }
                if (initTable.Constants != null)
                {
                    foreach (var constant in initTable.Constants)
                    {
                        AddConstant(constant);
                    }
                }
                if (initTable.Identifiers != null)
                {
                    foreach (var identifier in initTable.Identifiers)
                    {
                        AddIdentifier(identifier);
                    }
                }
            }
        }
예제 #5
0
        public SoundScape(string filename)
        {
            Initializer init = new Initializer(filename);

            InitTable soundscape = init.findData <InitTable>("Soundscape");

            volume = init.findDataOr <float>("volume", 1.0f);

            InitTable backgrounds = soundscape.findDataOr <InitTable>("Backgrounds", null);
            InitTable periodics   = soundscape.findDataOr <InitTable>("Periodics", null);

            //stupid lua tables go from 1-count
            for (int i = 1; i <= backgrounds.count(); i++)
            {
                InitTable bg = backgrounds.findData <InitTable>(i);
                addBackground(bg);
            }

            for (int i = 1; i <= periodics.count(); i++)
            {
                InitTable per = periodics.findData <InitTable>(i);
                addPeriodic(per);
            }
        }
예제 #6
0
        public void init(InitTable init)
        {
            String path = (String)init.findDataOr("shaderComponents", "../data/shaders");

            //read in the scripts to support the entity system
            //may need to move this to a resource
            myVm.doFile(path + "/shaderCompiler.lua");

            //read in all the entity files
            foreach (String file in Directory.GetFiles(path))
            {
                if (file.Contains(".comp") == true)
                {
                    Debug.print("Shader compiler evaluating component file: {0}", file);
                    myVm.doFile(file);
                }
            }

            myVsCompiler = myVm.findObject("compileVertexShader");
            myGsCompiler = myVm.findObject("compileGeometryShader");
            myPsCompiler = myVm.findObject("compilePixelShader");

            //createFileWatcher(path);
        }
예제 #7
0
 private void initTable()
 {
     _initTable = new InitTable
                      {
                          SharedData = _commonManagersInfoData,
                          CurrentRowInfoData = CurrentRowInfoData
                      };
     _initTable.CreateMainTable();
     _mainTable = _initTable.MainTable;
     _tableCellHelper = _initTable.TableCellHelper;
 }
예제 #8
0
        /// <summary>
        /// 确定,开始执行创建辅助库操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonXOK_Click(object sender, EventArgs e)
        {
            this._DesDSName = comboBoxEx2.Text;

            #region 创建辅助库的表对象


            if (comboBoxEx1.SelectedIndex == 0)   //本地辅助库
            {
                if (textBoxXServer.Text == "")
                {
                    SysCommon.Error.ErrorHandle.ShowInform("提示", "请设置辅助库连接!");
                    return;
                }
                if (textBoxXInstance.Text.Trim() == "")
                {
                    SysCommon.Error.ErrorHandle.ShowInform("提示", "请设置实例名称!");
                    return;
                }
                //初始化更新辅助库体结构和辅助要素类以及图幅结合表
                GOFuzingTables InitTable = new GOFuzingTables(textBoxXServer.Text + "\\" + textBoxXInstance.Text + ".mdb");
                InitTable.CreateDefaultFeatureClass("ice_CaseScope", false);
                InitTable.CreateDefaultTables(false, true);
                InitTable.CreateDefaultFeatureClass("ice_Map", true);
                InitTable.Dispose();
            }
            else if (comboBoxEx1.SelectedIndex == 1)    //远程辅助库
            {
                if (textBoxXServer.Text == "" || textBoxXInstance.Text == "" || textBoxXUser.Text == "" || textBoxXPassword.Text == "")
                {
                    SysCommon.Error.ErrorHandle.ShowInform("提示", "请设置辅助库连接!");
                    return;
                }
                IPropertySet pPropertySet = new PropertySetClass();
                pPropertySet.SetProperty("SERVER", textBoxXServer.Text);
                pPropertySet.SetProperty("INSTANCE", textBoxXInstance.Text);
                pPropertySet.SetProperty("USER", textBoxXUser.Text);
                pPropertySet.SetProperty("PASSWORD", textBoxXPassword.Text);
                pPropertySet.SetProperty("VERSION", "SDE.DEFAULT");

                //初始化更新辅助库体结构和辅助要素类以及图幅结合表
                GOFuzingTables InitTable = new GOFuzingTables(pPropertySet);
                InitTable.CreateDefaultFeatureClass("ice_CaseScope", false);
                InitTable.CreateDefaultTables(false, true);
                InitTable.CreateDefaultFeatureClass("ice_Map", true);
                InitTable.Dispose();
            }
            #endregion


            ///根据指定的更新目标的库体结构
            ///创建更新外部库表结构
            ///
            #region 根据指定的目标库体创建工作库体结构

            if (comboBoxEx1.SelectedIndex == 0)   //本地外部库
            {
                GOFuzingSpatialTables InitTable = null;

                if (comBoxType.SelectedIndex == 2)   //更新目标位PDB
                {
                    IPropertySet pPropertySet = new PropertySetClass();
                    pPropertySet.SetProperty("DATABASE", txtDataBase.Text);

                    InitTable = new GOFuzingSpatialTables(textBoxXServer.Text + "\\" + textBoxXInstance.Text + ".gdb", "PDB", pPropertySet);
                }
                else if (comBoxType.SelectedIndex == 0)  //更新目标为GDB
                {
                    IPropertySet pPropertySet = new PropertySetClass();
                    pPropertySet.SetProperty("DATABASE", txtDataBase.Text);
                    InitTable = new GOFuzingSpatialTables(textBoxXServer.Text + "\\" + textBoxXInstance.Text + ".gdb", "GDB", pPropertySet);
                }
                else if (comBoxType.SelectedIndex == 1)  //更新目标位SDE
                {
                    IPropertySet pPropertySet = new PropertySetClass();
                    pPropertySet.SetProperty("SERVER", txtServer.Text);
                    pPropertySet.SetProperty("INSTANCE", txtInstance.Text);
                    pPropertySet.SetProperty("USER", txtUser.Text);
                    pPropertySet.SetProperty("PASSWORD", txtPassWord.Text);
                    pPropertySet.SetProperty("VERSION", txtVersion.Text);
                    InitTable = new GOFuzingSpatialTables(textBoxXServer.Text + "\\" + textBoxXInstance.Text + ".gdb", "SDE", pPropertySet);
                }

                if (comboBoxEx2.Text == string.Empty)    //如果没有指定数据集
                {
                    ArrayList FCName = null;;
                    GetFCname("", out FCName);

                    foreach (string var in FCName)
                    {
                        InitTable.CreateDefaultFeatureClass(var, false);
                        InitTable.CreateDefaultFeatureClass(var + "_t", false, true);
                        InitTable.CreateDefaultFeatureClass(var + "_GOH", false, true);
                    }



                    //string[] strFCName=FCName.ToArray();
                    //for (int i = 0; i < strFCName.Length-1; i++)
                    //{

                    //    InitTable.CreateDefaultFeatureClass(strFCName[i], false);
                    //    InitTable.CreateDefaultFeatureClass(strFCName[i]+"_1", false);
                    //}
                }
                else   //如果指定了数据集
                {
                    ArrayList FCName = null;
                    GetFCname(comboBoxEx2.Text, out FCName);

                    Int32 i = 0;
                    foreach (string var in FCName)
                    {
                        if (i > 0)
                        {
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, false);
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, false, "_t");
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, false, "_GOH", true);
                        }
                        else
                        {
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, true);
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, true, "_t");
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, true, "_GOH", true);
                            i = i + 1;
                        }
                    }

                    //string[] strFCName=FCName.ToArray();

                    //for (int i = 0; i < strFCName.Length-1; i++)
                    //{
                    //    InitTable.CreateFeatureClassUnderDS(strFCName[i], comboBoxEx2.Text, false);
                    //    InitTable.CreateFeatureClassUnderDS(strFCName[i] + "_1", comboBoxEx2.Text + "_1", false);

                    //}
                }
                InitTable.Dispose();
            }
            else if (comboBoxEx1.SelectedIndex == 1)    //远程外部库
            {
                GOFuzingSpatialTables InitTable = null;

                if (comBoxType.SelectedIndex == 2)   //更新目标位PDB
                {
                    IPropertySet pPropertySet = new PropertySetClass();
                    pPropertySet.SetProperty("DATABASE", txtDataBase.Text);

                    ///外部库在SDE上时
                    IPropertySet pOutPropertySet = new PropertySetClass();
                    pOutPropertySet.SetProperty("SERVER", textBoxXServer.Text);
                    pOutPropertySet.SetProperty("INSTANCE", textBoxXInstance.Text);
                    pOutPropertySet.SetProperty("USER", textBoxXUser.Text);
                    pOutPropertySet.SetProperty("PASSWORD", textBoxXPassword.Text);
                    pOutPropertySet.SetProperty("VERSION", "SDE.DEFAULT");


                    InitTable = new GOFuzingSpatialTables(pOutPropertySet, "PDB", pPropertySet);
                }
                else if (comBoxType.SelectedIndex == 0)  //更新目标为GDB
                {
                    IPropertySet pPropertySet = new PropertySetClass();
                    pPropertySet.SetProperty("DATABASE", txtDataBase.Text);


                    ///外部库在SDE上时
                    IPropertySet pOutPropertySet = new PropertySetClass();
                    pOutPropertySet.SetProperty("SERVER", textBoxXServer.Text);
                    pOutPropertySet.SetProperty("INSTANCE", textBoxXInstance.Text);
                    pOutPropertySet.SetProperty("USER", textBoxXUser.Text);
                    pOutPropertySet.SetProperty("PASSWORD", textBoxXPassword.Text);
                    pOutPropertySet.SetProperty("VERSION", "SDE.DEFAULT");

                    InitTable = new GOFuzingSpatialTables(pOutPropertySet, "GDB", pPropertySet);
                }
                else if (comBoxType.SelectedIndex == 1)  //更新目标位SDE
                {
                    IPropertySet pPropertySet = new PropertySetClass();
                    pPropertySet.SetProperty("SERVER", txtServer.Text);
                    pPropertySet.SetProperty("INSTANCE", txtInstance.Text);
                    pPropertySet.SetProperty("USER", txtUser.Text);
                    pPropertySet.SetProperty("PASSWORD", txtPassWord.Text);
                    pPropertySet.SetProperty("VERSION", txtVersion.Text);

                    ///外部库在SDE上时
                    IPropertySet pOutPropertySet = new PropertySetClass();
                    pOutPropertySet.SetProperty("SERVER", textBoxXServer.Text);
                    pOutPropertySet.SetProperty("INSTANCE", textBoxXInstance.Text);
                    pOutPropertySet.SetProperty("USER", textBoxXUser.Text);
                    pOutPropertySet.SetProperty("PASSWORD", textBoxXPassword.Text);
                    pOutPropertySet.SetProperty("VERSION", "SDE.DEFAULT");

                    InitTable = new GOFuzingSpatialTables(pOutPropertySet, "SDE", pPropertySet);
                }

                if (comboBoxEx2.Text == string.Empty)    //如果没有指定数据集
                {
                    ArrayList FCName = null;;
                    GetFCname("", out FCName);

                    foreach (string var in FCName)
                    {
                        InitTable.CreateDefaultFeatureClass(var, false);
                        InitTable.CreateDefaultFeatureClass(var + "_t", false);
                    }



                    //string[] strFCName=FCName.ToArray();
                    //for (int i = 0; i < strFCName.Length-1; i++)
                    //{

                    //    InitTable.CreateDefaultFeatureClass(strFCName[i], false);
                    //    InitTable.CreateDefaultFeatureClass(strFCName[i]+"_1", false);
                    //}
                }
                else   //如果指定了数据集
                {
                    ArrayList FCName = null;
                    GetFCname(comboBoxEx2.Text, out FCName);

                    Int32 i = 0;
                    foreach (string var in FCName)
                    {
                        if (i > 0)
                        {
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, false);
                            InitTable.CreateFeatureClassUnderDS(var + "_t", comboBoxEx2.Text + "_t", false, false);
                        }
                        else
                        {
                            InitTable.CreateFeatureClassUnderDS(var, comboBoxEx2.Text, false, true);
                            InitTable.CreateFeatureClassUnderDS(var + "_t", comboBoxEx2.Text + "_t", false, true);
                            i = i + 1;
                        }
                    }

                    //string[] strFCName=FCName.ToArray();

                    //for (int i = 0; i < strFCName.Length-1; i++)
                    //{
                    //    InitTable.CreateFeatureClassUnderDS(strFCName[i], comboBoxEx2.Text, false);
                    //    InitTable.CreateFeatureClassUnderDS(strFCName[i] + "_1", comboBoxEx2.Text + "_1", false);

                    //}
                }
                InitTable.Dispose();
            }
            #endregion

            ///将更新环境数据库访问方式写入xml文档对象
            ///
            DevComponents.AdvTree.Node pCurNode = m_Hook.ProjectTree.SelectedNode; ///获得树图上选择的工程节点

            string pProjectname = pCurNode.Name;

            System.Xml.XmlNode    Projectnode        = m_Hook.DBXmlDocument.SelectSingleNode("工程管理/工程[@名称='" + pProjectname + "']");
            System.Xml.XmlElement ProjectNodeElement = Projectnode as System.Xml.XmlElement;

            System.Xml.XmlElement ProjectAidConnEle = ProjectNodeElement.SelectSingleNode(".//更新库/配置库/连接信息") as System.Xml.XmlElement;
            ///设置数据库连接类型

            ///
            if (comboBoxEx1.SelectedIndex == 0)
            {
                ProjectAidConnEle.SetAttribute("类型", "Access");
            }
            else if (comboBoxEx1.SelectedIndex == 1)
            {
                ProjectAidConnEle.SetAttribute("类型", "Oracle");
            }

            ///设置具体连接方式
            ///
            if (comboBoxEx1.SelectedIndex == 0)
            {
                string text = textBoxXServer.Text + "\\" + textBoxXInstance.Text + ".mdb";
                ProjectAidConnEle.SetAttribute("数据库", text);
            }
            else if (comboBoxEx1.SelectedIndex == 1)
            {
                ProjectAidConnEle.SetAttribute("数据库", textBoxXServer.Text);
                ProjectAidConnEle.SetAttribute("用户", textBoxXUser.Text);
                ProjectAidConnEle.SetAttribute("密码", textBoxXPassword.Text);
            }

            System.Xml.XmlElement ProjectTempDBConnEle = ProjectNodeElement.SelectSingleNode(".//更新库/数据库/连接信息") as System.Xml.XmlElement;

            ProjectTempDBConnEle.SetAttribute("类型", "GDB");
            ProjectTempDBConnEle.SetAttribute("数据库", textBoxXServer.Text + "\\" + textBoxXInstance.Text + ".gdb");

            System.Xml.XmlElement CurDBEle = ProjectTempDBConnEle.SelectSingleNode("库体[@类型='现势']") as System.Xml.XmlElement;
            CurDBEle.SetAttribute("名称", comboBoxEx2.Text);
            System.Xml.XmlElement TempDBEle = ProjectTempDBConnEle.SelectSingleNode("库体[@类型='工作']") as System.Xml.XmlElement;
            TempDBEle.SetAttribute("名称", comboBoxEx2.Text + "_t");
            System.Xml.XmlElement HisDBEle = ProjectTempDBConnEle.SelectSingleNode("库体[@类型='历史']") as System.Xml.XmlElement;
            HisDBEle.SetAttribute("名称", comboBoxEx2.Text + "_GOH");

            m_Hook.DBXmlDocument.Save(ModData.v_projectXML);


            //释放类成员

            if (_UpadateDesWorkspace != null)
            {
                System.Runtime.InteropServices.Marshal.ReleaseComObject(_UpadateDesWorkspace);
            }

            SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "更新环境初始化完成!");
            this.Close();
        }
예제 #9
0
 public static void init(InitTable initializer = null)
 {
     if (initializer != null)
     {
     }
 }