コード例 #1
0
 public Vegetation(Map map, Point StartPosition)
 {
     _map      = map;
     _position = StartPosition;
     _texture  = VegetationTexture.Tree;
     _size     = new Size(400, 400);
 }
コード例 #2
0
        public void CreateVegetation(VegetationTexture texture)
        {
            Vegetation v;

            switch (texture)
            {
            case VegetationTexture.Tree:
                v = new Tree(this._map, _vegetationSelectorCursor);
                break;

            case VegetationTexture.Bush:
                v = new Bush(this._map, _vegetationSelectorCursor);
                break;

            case VegetationTexture.Rock:
                v = new Rock(this._map, _vegetationSelectorCursor);
                break;

            default:
                throw new NotSupportedException("Unknown vegetation type");
            }
            _map.Vegetation.Add(v);
        }
コード例 #3
0
 private void bushToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _selectedVegetation = VegetationTexture.Bush;
 }
コード例 #4
0
 private void rockToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _selectedVegetation = VegetationTexture.Rock;
 }
コード例 #5
0
 private void treeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _selectedVegetation = VegetationTexture.Tree;
 }