using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using Microsoft.DirectX;
using System.Drawing;
using Microsoft.DirectX.Direct3D;

namespace Obligatorisk
{
    class Model
    {
        private Engine theEngine;
        private List<Keys> pressedKeys;
        private Ground ground;

        #region 3D-model Car (Morten) 27. April.
        private Car AudiA4;
        #endregion
        #region  3D-models (Jon) 20. april
        private Airtower airtower;
        private Airtower airtower_2;
        private Airtower airtower_3;
        private Airtower airtower_4;

        private Comtower comtower;
        private Comtower comtower_2;
        private Comtower comtower_3;
        private Comtower comtower_4;

        private House house;
        private House house_2;
        private House house_3;
        private House house_4;
        #endregion

        public Model(Engine anEngine)
        {
            theEngine = anEngine;
            this.pressedKeys = new List<Keys>();
            this.ground = new Ground(this.theEngine.GetDevice());
            #region 3D-model Car (Morten) 27. April.
            this.AudiA4 = new Car(this, this.theEngine.GetDevice(), new Vector3(5,0,0));
            #endregion
            #region  3D-models  (Jon) 20. april
            airtower = new Airtower(this, theEngine.GetDevice(), new Vector3(30, 0, 0));
            airtower_2 = new Airtower(this, theEngine.GetDevice(), new Vector3(-40, 0, 0));
            airtower_3 = new Airtower(this, theEngine.GetDevice(), new Vector3(-90, 0, 20));
            airtower_4 = new Airtower(this, theEngine.GetDevice(), new Vector3(80, 0, 6));

            comtower = new Comtower(this, theEngine.GetDevice(), new Vector3(60, 0, 0));
            comtower_2 = new Comtower(this, theEngine.GetDevice(), new Vector3(60, 0, 30));
            comtower_3 = new Comtower(this, theEngine.GetDevice(), new Vector3(-20, 0, 70));
            comtower_4 = new Comtower(this, theEngine.GetDevice(), new Vector3(40, 0, 50));

            house = new House(this, theEngine.GetDevice(), new Vector3(-10, 0, 50));
            house_2 = new House(this, theEngine.GetDevice(), new Vector3(-70, 0, 35));
            house_3 = new House(this, theEngine.GetDevice(), new Vector3(30, 0, 50));
            house_4 = new House(this, theEngine.GetDevice(), new Vector3(20, 0, 90));
            #endregion
        }

        public void Render()
        {
            ground.Render();
            #region 3D-model Car (Morten) 27. April.
            AudiA4.Render();
            #endregion        
            #region  3D-models  (Jon) 20. april
            airtower.Render();
            airtower_2.Render();
            airtower_3.Render();
            airtower_4.Render();
            comtower.Render();
            comtower_2.Render();
            comtower_3.Render();
            comtower_4.Render();
            house.Render();
            house_2.Render();
            house_3.Render();
            house_4.Render();
            #endregion
        }

        public void UpdateModel()
        {
            AudiA4.Update();
        }
        public float Speed
        {
            get { return this.AudiA4.Speed; }
        }
        public Car.Gears Gear
        {
            get { return this.AudiA4.Gear; }
        }
        public float YawIncrement
        {
            get { return this.AudiA4.YawIncrement; }
        }
        public float Distance
        {
            get { return this.AudiA4.Distance; }
        }
        public List<Keys> PressedKeys
        {
            set { this.pressedKeys = value; }
            get { return this.pressedKeys; }
        }
    }
}
