Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 10-20-2011, 01:56 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Make a class with all infos you need and then store the objects in a list.

For example :
Code:
using System;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;

public class Mission : AMission
{
    public static string SubMissionsPath = @"missions\Multi\Dogfight\test\subs\";
    
    
    public class Mis
    {
        public string Missionfilename {get; set;}
        public string PathToMission { get; set; }
        public DateTime MissionBegin{get; set;}
        public DateTime MissionEnd{get; set;}
        public double MissionLengh{get; set;}
        public bool IsMissionRunning { get; set; }
    
        public Mis(string Filename, string Path, double Lengh)
        {
            this.Missionfilename = Filename;
            this.PathToMission = Path;
            this.MissionLengh = Lengh;
        }
    
    }

    public List<Mis> MissionPool = new List<Mis>()
    {
        new Mis ("Mission1.mis",SubMissionsPath ,1000.0),
        new Mis ("Mission2.mis",SubMissionsPath ,1000.0),
    };


    public override void OnBattleStarted()
    {
        base.OnBattleStarted();


        MissionNumberListener = -1;

        try
        {
            foreach (Mis mi in MissionPool)
                GamePlay.gpPostMissionLoad(mi.PathToMission + mi.Missionfilename);

        }
        catch
        {

            GamePlay.gpLogServer(null, "File not found", null);
        }
    }


    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);

    }
}

Last edited by FG28_Kodiak; 10-20-2011 at 02:13 PM.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:03 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.