Exemple #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;
        }
Exemple #2
0
    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);
            }
        }
    }
        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();
        }
 public virtual bool ContainsBond(params ElementStack[] stacks)
 {
     return(StructureTree.ContainsBond(stacks));
 }
 public virtual bool ContainsBond(params Element[] elements)
 {
     return(StructureTree.ContainsBond(elements));
 }
 public virtual bool AreAtomsCountEqual(ChemicalCompound compound)
 {
     return(StructureTree.AreAtomsCountEqual(compound.StructureTree));
 }
 public virtual int GetTotalNeutronsCount()
 {
     return(StructureTree.GetTotalNeutronsCount());
 }
 public virtual IEnumerable <ElementStack> GetAtoms()
 {
     return(StructureTree.GetAtoms());
 }
 public int GetTotalProtonsCount()
 {
     return(StructureTree.GetTotalProtonsCount());
 }
 public int GetTotalElectronsCount()
 {
     return(StructureTree.GetTotalElectronsCount());
 }
 public OldTerrainGen(Noise noise)
 {
     noiseGen      = noise;
     treeStructure = new StructureTree();
 }
Exemple #12
0
 public override void Apply(Chunk chunk)
 {
     StructureTree.GenerateTrunkPart(chunk, ref min, ref max);
 }
Exemple #13
0
 public override void Apply(Chunk chunk)
 {
     StructureTree.GenerateCrownPart(chunk, ref worldPos, ref min, ref max, noise);
 }
 public OldTerrainGen(Noise noise)
 {
     noiseGen = noise;
     treeStructure = new StructureTree();
 }