Exemple #1
0
        public string createNewCampaign(string playerid, string fielddimension)
        {
            Player player = getPlayer(playerid);
            if (player == null)
                return "";

            // Datenbank
            ICampaignDatabase database = (ICampaignDatabase)getCampaignDbOrNew("");

            // Spielfeld
            Field field = new Field(3, 3);

            // Engine
            CampaignEngine engine = new CampaignEngine(field);
            engine.FieldField.Id = 123;
            engine.addPlayer(player);
            engine.addUnit(player, new clsUnit(new Random().Next(1000, 9999).ToString(), 0), field.getSektorList()[0]);

            CampaignController controller = new CampaignController();
            controller.CampaignDataBase = database;
            controller.campaignEngine = engine;
            controller.CampaignKey = database.CampaignKey;
            controller.saveCurrentGameState();

            m_dictLoadedController[controller.CampaignKey] = controller;
            return database.CampaignKey;
        }