Пример #1
0
    static public void RecycleName(StrategicShip s)
    {
        string n = usedNamesStrategicShip[s];

        usedNames.Remove(n);
        names.Add(n);
    }
    //Creates the actual strategic ship
    public void CompleteShip(ShipDesign design)
    {
        StrategicShip  s = new StrategicShip(design, empire);
        EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 4, empire, "STARSHIP CONSTRUCTED", string.Format("{0} has <color=green>finished construction</color> of a <color=silver>{1}</color>-Class {2}, the {3}.", ShipYardName, s.DesignClass.DesignName, s.DesignClass.HullDesignation.HullType, s.ShipName));

        DockedShips.Add(s);
        //TODO actually make the ship reference for the fleet list.  TODO is this still necessary?
    }
Пример #3
0
 public void RemoveShip(StrategicShip s)
 {
     if (Ships.Contains(s))
     {
         Ships.Remove(s);
     }
     s.ParentFleet = null;
     RegenerateFleetShipNames();
 }
Пример #4
0
 public void AddShip(StrategicShip s)
 {
     if (!Ships.Contains(s))
     {
         Ships.Add(s);
     }
     s.ParentFleet = this;
     RegenerateFleetShipNames();
 }
Пример #5
0
    public void StepDownXO(StrategicShip s)
    {
        SetAssigned(false);
        MoveTo(s);
        //	s.AssignOfficer (this, NavalCommanderRole.XO);
        NavalRole = NavalCommanderRole.NONE;
        string st = string.Format("{0}: <color=navy>{1}</color> <color=orange>stands down</color> as <color=cyan>Executive Officer</color> of <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ShipName);

        AddHistory(st);
    }
Пример #6
0
    static public string AssignName(StrategicShip ship)
    {
        int    index = rand.Next(0, names.Count);
        string name  = names[index];          //AssignNumeral(names[]) ?? names[rand.Next(0, names.Count)];

        names.Remove(name);
        usedNames.Add(name);
        Frequency [name]++;
        usedNamesStrategicShip.Add(ship, name);
        return(name + AssignNumeral(name));
    }
Пример #7
0
    public void Assign(StrategicShip c)
    {
        S = c;
        Text t = GetComponentInChildren <Text> ();

        try{
            t.text     = S.ShipName;
            t.fontSize = 20;
        }
        catch {
        }
//		t.resizeTextForBestFit = true;
    }
Пример #8
0
    public void AppointXO(StrategicShip s)
    {
        if (s.Executive == this)
        {
            return;
        }
        SetAssigned(true);
        MoveTo(s);
        //	shipPosting = s;
        s.AssignOfficer(this, NavalCommanderRole.XO);
        NavalRole = NavalCommanderRole.XO;
        string st = string.Format("{0}: <color=navy>{1}</color> is <color=green>appointed</color> <color=cyan>Executive Officer</color> of <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ShipName);

        AddHistory(st);
    }
Пример #9
0
    public string GetName(StrategicShip unit, Theme theme = null)
    {
        string       name   = "null";
        List <Range> Ranges = new List <Range> ();

        if (theme == null)
        {
            float last  = 0f;
            Theme lastT = null;
            foreach (Theme t in EmpireThemes.Keys)
            {
                if (lastT == null)
                {
                    last = 0;
                }
                Ranges.Add(new Range(last, last + EmpireThemes[t], t));
                lastT = t;
            }
            float roll = rnd.NextFloat(0, last);
            foreach (Range r in Ranges)
            {
                if (r.InRange(roll))
                {
                    theme = r.theme;
                }
                name = ThemeManager.Manager.GetName(unit, theme);
            }
        }
        else
        {
            name = ThemeManager.Manager.GetName(unit, theme);
        }
        if (name == "null")
        {
            name = ThemeManager.Manager.GetName(unit, ThemeManager.ThemesDict ["Alliance"]);
        }
        return(name);
    }
Пример #10
0
 public string GetName(StrategicShip sh, Theme the)
 {
     return(the.ShipNames [rnd.Next(0, the.ShipNames.Count)]);
 }
Пример #11
0
 public void AssignShip(StrategicShip s)
 {
     S = s;
     UpdateUI();
 }
Пример #12
0
 public void SelectShip(StrategicShip S)
 {
     SelectedShip = S;
     UpdateShipDetails();
 }