コード例 #1
0
        private void PlaceTreeOnEarth(Tree tree)
        {
            int x = _rnd.Next(EARTH_MIN_X, EARTH_MAX_X);
            int y = _rnd.Next(EARTH_MIN_Y, EARTH_MAX_Y);

            Console.WriteLine($"Planting tree on ({x},{y})");
        }
コード例 #2
0
 public async Task Init()
 {
     _treeCollection = new Tree[]
     {
         new PsychodelicTree(_rnd.Next(100, 500), _rnd.Next(50, 100)),
         new HawthornTree(_rnd.Next(100, 500), _rnd.Next(50, 100)),
         new ArborvitaeTree(_rnd.Next(100, 500), _rnd.Next(50, 100))
     };
     foreach (var tree in _treeCollection)
     {
         await tree.Render();
     }
 }