Example #1
0
        public void Draw(World world)
        {
            Dictionary<Coordinate, Tile> map = world.Map;

            foreach (var tile in map)
                tile.Value.Draw();
        }
Example #2
0
 public MainForm(World world)
 {
     InitializeComponent();
     _mainDrawingBox.InitializeContexts();
     _world = world;
     _worldPainter = new WorldPainter();
 }
Example #3
0
 public SettingsForm(LauncherForm parentForm)
 {
     InitializeComponent();
     _preGenPictureBox.InitializeContexts();
     _world = new World();
     _parentForm = parentForm;
 }
Example #4
0
        private void bStartClick(object sender, EventArgs e)
        {
            World world = new World();
            world.Load(worldsDB.Select(_cbSelectWorld.Text));

            MainForm mainForm = new MainForm(world);
            mainForm.Show();
        }
Example #5
0
        public void Add(World world, string path)
        {
            string realPath = world.Name;

            realPath = realPath.ToLower();
            realPath = realPath.Replace(' ', '_');
            realPath += MainStrings.XmlFormat;
            realPath = path + realPath;

            world.Save(realPath);

            _worlds.Add(world.Name, realPath);

            XDocument loadFile = XDocument.Load(_path);
            XElement mainElement = loadFile.Element(Tags.WorldsTag);

            XElement newWorld = new XElement(Tags.WorldTag,
                new XAttribute(Tags.NameTag, world.Name),
                new XAttribute(Tags.PathTag, realPath));

            mainElement.Add(newWorld);

            loadFile.Save(_path);
        }
 public void Draw(World world)
 {
     CustomWorldPainter painter = new CustomWorldPainter(new HumidityTilePainter());
     painter.Draw(world);
 }
 public void Draw(World world)
 {
     CustomWorldPainter painter = new CustomWorldPainter(new TemperatureTilePainter());
     painter.Draw(world);
 }
Example #8
0
        private void GenerateClick(object sender, EventArgs e)
        {
            try {
                _world = new World(Convert.ToInt32(_tbWidth.Text), Convert.ToInt32(_tbHeight.Text), _tbName.Text);

                _world.Generation(new RandomWorldGenerator(tileList, Convert.ToInt32(_cbSmoothing.Text)));

                CustomizeDrawingBox();
                Draw();

                _bSave.Enabled = true;
            }
            catch(Exception exp)
            {
                MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }