コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            StructureParser       parser    = new StructureParser(this.richTextBox1.Text);
            StructureTree         root      = parser.Parse();
            MetaModel             metamodel = root.Build();
            MetaTemplateConverter converter = new MetaTemplateConverter();
            TemplateContainer     container = converter.Convert(metamodel);
            string template = "Domains:\n========\n[%foreach(domain in Domains)%]\n	Id: [%domain.Id%]\n	Name: [%domain.Name%]\n	IsIdentity: [%domain.IsIdentity%]\n	DataType: [%domain.DataType%]\n	Length: [%domain.DataTypeLength%]\n	Decimals: [%domain.DataTypeDecimals%]\n[%end%]\n";

            template += "Tables:\n=======\n[%foreach(table in Tables)%]\n	Id: [%table.Id%]\n	Name: [%table.Name%]\n	LogicalName: [%table.LogicalName%]\n	PhysicalName: [%table.PhysicalName%]\n	[\n[%foreach(column in table.Columns)%]		TableId: [%column.TableId%]\n		Ix: [%column.Ix%]\n		Name: [%column.Name%]\n		LogicalName: [%column.LogicalName%]\n		PhysicalName: [%column.PhysicalName%]\n		IsPrimaryKey: [%column.IsPrimaryKey%]\n		IsNullable: [%column.IsNullable%]\n		IsIdentity: [%column.IsIdentity%]\n		DataType: [%column.DataType%]\n		Length: [%column.DataTypeLength%]\n		Decimals: [%column.DataTypeDecimals%]\n		IsForeignKey: [%column.IsForeignKey%]\n	[%end%]\n][%end%]\n";
            template  = TemplateTransformer.Transform(template);
            template  = JavascriptEvaluator.ReplaceString(template, container);
            this.richTextBox2.Text = template;
        }
コード例 #2
0
ファイル: TerrainGen.cs プロジェクト: maroussil/Voxelmetric
    void CreateTreeIfValid(int x, int z, Chunk chunk)
    {
        if (GetNoise(x + chunk.pos.x, 0, z + chunk.pos.z, 0.2f, 100, 1) < 3)
        {
            int terrainHeight = LayerStoneBase(x + chunk.pos.x, z + chunk.pos.z);
            terrainHeight += LayerStoneNoise(x + chunk.pos.x, z + chunk.pos.z);
            terrainHeight += LayerDirt(x + chunk.pos.x, z + chunk.pos.z);;


            if (StructureTree.ChunkContains(chunk, new BlockPos(x + chunk.pos.x, terrainHeight, z + chunk.pos.z)))
            {
                StructureTree.Build(chunk, new BlockPos(x, terrainHeight - chunk.pos.y, z), this);
            }
        }
    }
コード例 #3
0
        private void OrderListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var listBox = (ListBox)sender;

            if (listBox.SelectedItem == null)
            {
                return;
            }

            if (listBox.SelectedIndex == 0)
            {
                PreviewControl.IsFirstSelected = true;
            }
            else
            {
                PreviewControl.IsFirstSelected = false;
            }

            orderSelected = true;
            var selectedPart = ((SongPartReference)listBox.SelectedItem).Part;

            if (selectedPart.Slides.Count > 0)
            {
                StructureTree.SelectItem(selectedPart.Slides[0]);
                if (listBox.SelectedIndex == listBox.Items.Count - 1 && selectedPart.Slides.Count == 1)
                {
                    PreviewControl.IsLastSelected = true;
                }
                else
                {
                    PreviewControl.IsLastSelected = false;
                }
            }
            else
            {
                StructureTree.SelectItem(selectedPart);
            }
            orderSelected = false;

            listBox.Focus();
        }
コード例 #4
0
 public virtual bool ContainsBond(params ElementStack[] stacks)
 {
     return(StructureTree.ContainsBond(stacks));
 }
コード例 #5
0
 public virtual bool ContainsBond(params Element[] elements)
 {
     return(StructureTree.ContainsBond(elements));
 }
コード例 #6
0
 public virtual bool AreAtomsCountEqual(ChemicalCompound compound)
 {
     return(StructureTree.AreAtomsCountEqual(compound.StructureTree));
 }
コード例 #7
0
 public virtual int GetTotalNeutronsCount()
 {
     return(StructureTree.GetTotalNeutronsCount());
 }
コード例 #8
0
 public virtual IEnumerable <ElementStack> GetAtoms()
 {
     return(StructureTree.GetAtoms());
 }
コード例 #9
0
 public int GetTotalProtonsCount()
 {
     return(StructureTree.GetTotalProtonsCount());
 }
コード例 #10
0
 public int GetTotalElectronsCount()
 {
     return(StructureTree.GetTotalElectronsCount());
 }
コード例 #11
0
 public OldTerrainGen(Noise noise)
 {
     noiseGen      = noise;
     treeStructure = new StructureTree();
 }
コード例 #12
0
 public override void Apply(Chunk chunk)
 {
     StructureTree.GenerateTrunkPart(chunk, ref min, ref max);
 }
コード例 #13
0
 public override void Apply(Chunk chunk)
 {
     StructureTree.GenerateCrownPart(chunk, ref worldPos, ref min, ref max, noise);
 }
コード例 #14
0
 public OldTerrainGen(Noise noise)
 {
     noiseGen = noise;
     treeStructure = new StructureTree();
 }