public static Outpost CreateOutpostWithId(
            string id,
            OutpostType outpostType,
            Player owner,
            RftVector outpostLocation,
            int initialDrillers = Constants.InitialDrillersPerOutpost
            )
        {
            Outpost outpost = null;

            switch (outpostType)
            {
            case OutpostType.Factory:
                outpost = new Factory(id, outpostLocation, owner);
                break;

            case OutpostType.Generator:
                outpost = new Generator(id, outpostLocation, owner);
                break;

            case OutpostType.Mine:
                outpost = new Mine(id, outpostLocation, owner);
                break;

            case OutpostType.Watchtower:
                outpost = new Watchtower(id, outpostLocation, owner);
                break;

            default:
                return(null);
            }
            outpost.GetComponent <DrillerCarrier>().SetDrillerCount(initialDrillers);
            return(outpost);
        }
Esempio n. 2
0
 /// <summary>
 /// Outpost constructor; should only be used when it is necessary to change the type of an outpost (i.e. when converting an outpost to a mine)
 /// </summary>
 /// <param name="o">The outpost to copy components from</param>
 public Outpost(Outpost o)
 {
     AddComponent(o.GetComponent <DrillerCarrier>());
     AddComponent(o.GetComponent <SpeedManager>());
     AddComponent(o.GetComponent <PositionManager>());
     AddComponent(o.GetComponent <SpecialistManager>());
     AddComponent(o.GetComponent <IdentityManager>());
     AddComponent(o.GetComponent <ShieldManager>());
     AddComponent(o.GetComponent <SubLauncher>());
     AddComponent(o.GetComponent <VisionManager>());
 }
Esempio n. 3
0
 /// <summary>
 /// Mine constructor. Use in preparation to replace a non-mine outpost with a mine outpost with the same properties.
 /// </summary>
 /// <param name="o">The outpost to replicate as a mine</param>
 public Mine(Outpost o) : base(o)
 {
 }