Esempio n. 1
0
 public Ship(Captain captain, int maxNumberOfPeople, Wheel wheel, Sails sails)
 {
     _captain           = captain;
     _maxNumberOfPeople = maxNumberOfPeople;
     _wheel             = wheel;
     _sails             = sails;
 }
Esempio n. 2
0
    public Caravel_Sails(CaravelInterface newShip) : base(newShip)
    {
        //currently uses new keyword, but because Plating is a unity MonoBehavior, throws console a warning (not sure how to fix)
        Sails newSails = new Sails();

        newSails.AddSails();
    }
Esempio n. 3
0
        /// <summary>
        /// Konstruktor. Lädt die angegebene Datei.
        /// </summary>
        /// <param name="filename">Die zu ladende Datei.</param>
        public ShipFile(string filename)
            : this()
        {
            // Datei laden
            RAMBuffer buffer = new RAMBuffer(filename);

            // Namen lesen
            Name = buffer.ReadString(buffer.ReadInteger());

            // Rumpf-SLP lesen
            if (buffer.ReadByte() == 1)
            {
                BaseSlp = new SLPFile(buffer);
            }

            // Schatten-SLP lesen
            if (buffer.ReadByte() == 1)
            {
                ShadowSlp = new SLPFile(buffer);
            }

            // Segel lesen
            int sailCount = buffer.ReadByte();

            for (int i = 0; i < sailCount; ++i)
            {
                // Lesen
                Sail.SailType currType = (Sail.SailType)buffer.ReadByte();
                Sail          currSail = new Sail(buffer);
                Sails.Add(currType, currSail);
            }

            // Invertierte Segeltypen lesen
            int invSailCount = buffer.ReadByte();

            for (int i = 0; i < invSailCount; ++i)
            {
                InvertedSails.Add((Sail.SailType)buffer.ReadByte());
            }

            // 0 -> 0, 10 -> 0, 20 -> 10, 30 -> 10, 40 -> 20, 50 -> 20, 60 -> 30, 70 -> 30, 80 -> 40

            /*func(Sail.SailType.MainGo, Civ.AS, Properties.Resources.MainGo_AS);
             * func(Sail.SailType.MainGo, Civ.IN, Properties.Resources.MainGo_IN);
             * func(Sail.SailType.MainGo, Civ.ME, Properties.Resources.MainGo_ME);
             * func(Sail.SailType.MainGo, Civ.OR, Properties.Resources.MainGo_OR);
             * func(Sail.SailType.MainGo, Civ.WE, Properties.Resources.MainGo_WE);
             * func(Sail.SailType.MainStop, Civ.AS, Properties.Resources.MainStop_AS);
             * func(Sail.SailType.MainStop, Civ.IN, Properties.Resources.MainStop_IN);
             * func(Sail.SailType.MainStop, Civ.ME, Properties.Resources.MainStop_ME);
             * func(Sail.SailType.MainStop, Civ.OR, Properties.Resources.MainStop_OR);
             * func(Sail.SailType.MainStop, Civ.WE, Properties.Resources.MainStop_WE);
             *
             * Save(Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename) + "_converted.ship"));*/
        }
Esempio n. 4
0
    void Awake()
    {
        sails     = GetComponentInChildren <Sails> ();
        rudder    = GetComponentInChildren <Rudder> ();
        physics   = GetComponentInChildren <BoatPhysics>();
        rigidBody = GetComponent <Rigidbody> ();
        weapons   = GetComponentInChildren <ShipWeapons>();

        destination = transform.position;

        speedModifier = 1f;
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        rigidBody     = GetComponent <Rigidbody>();
        submergedTris = new List <TriangleData>();
        originalMesh  = bodyMesh.mesh;

        angularDrag            = rigidBody.angularDrag;
        rigidBody.centerOfMass = centerOfMass;

        sails  = GetComponentInChildren <Sails>();
        rudder = GetComponentInChildren <Rudder>();

        SetupMeshData(originalMesh);
    }
Esempio n. 6
0
 void Start()
 {
     rudder  = GetComponentInChildren <Rudder>();
     sails   = GetComponentInChildren <Sails>();
     weapons = GetComponent <ShipWeapons>();
 }
Esempio n. 7
0
 public void SetSailsDown(Sails sails)
 {
     Console.WriteLine("Set Sails down");
 }
Esempio n. 8
0
 public void SetSailsUp(Sails sails)
 {
     Console.WriteLine("Set Sails up");
 }
Esempio n. 9
0
 void Start()
 {
     hull = GetComponent<Hull>();
     turrets = GetComponent<Turrets>();
     sails = GetComponent<Sails>();
 }