View Single Post
  #16  
Old 10-21-2011, 05:09 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by FG28_Kodiak View Post
Filename is only used in the constructor to give the value to the variable Missionfilename.
Does it mean I can initialize variables in this block, replacing e.g. Length with a value I want to assign?
this.MissionLengh = 30;

Ah, it looks like the only purpose of it is to allow data input like here:
Code:
  public List<Mis> MissionPool = new List<Mis>()
    {
        new Mis ("Mission1.mis",SubMissionsPath ,1000.0),
        new Mis ("Mission2.mis",SubMissionsPath ,1000.0),
    };
So when I create a new Mis I can enter data there from e.g. parsed filename in one line only, not having to use 3 lines like
mi.Missionfilename = ...;
mi.SubMissionsPath = ...;
mi.MissionLengh = ...;

Instead after parsing a file name I can:
Code:
string[] MisParams;
MisParams = (mi.Missionfilename).Split('_');

Mis mi = new Mis (MisParams[1], MisParams[2],MisParams[3]);
Thanks a lot!

Last edited by Ataros; 10-21-2011 at 05:30 PM.
Reply With Quote