Esempio n. 1
0
        protected override void Awake()
        {
            base.Awake();

            blueContainer = GetUIContainer <TeamContainer>(0);
            redContainer  = GetUIContainer <TeamContainer>(1);
        }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        teams.getData();
        chosenTeam = teams.getTeamByID(PlayerPrefs.GetInt("selectedTeam"));
        house      = GameObject.FindGameObjectWithTag("Defence Point");

        GameObject dynFind = GameObject.Find("Dynamic Objects");

        if (dynFind != null)
        {
            dynamicObjectHolder = dynFind;
        }
        else
        {
            dynamicObjectHolder = new GameObject("Dynamic Objects");
        }

        //Jordan Add Power Code
        for (int i = 0; i < chosenTeam.teamArray.Length; i++)
        {
            Debug.Log("PC: " + chosenTeam.teamArray[i].powerClass);
            gameObject.AddComponent(chosenTeam.teamArray[i].powerClass);
            Debug.Log("PC: " + chosenTeam.teamArray[i].powerClass + "Out");
        }

        Component[] c = gameObject.GetComponents(typeof(Component));

        for (int i = 0; i < 5; i++)
        {
            gameObject.AddComponent(c[0].GetType());
        }
    }
Esempio n. 3
0
        public HttpResponseMessage Get(string tenant_id)
        {
            List <TeamContainer> nulledteams = new List <TeamContainer>();

            var Teams = TeamService.GetAll().Where(o => o.Owner == tenant_id);


            if (Teams == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound, "No content or wrong tenant id"));
            }

            else
            {
                foreach (Team t in Teams)
                {
                    TeamContainer tc = new TeamContainer();
                    tc.TeamID          = t.TeamID;
                    tc.TeamName        = t.TeamName;
                    tc.TeamDescription = t.TeamDescription;
                    nulledteams.Add(tc);
                }



                return(Request.CreateResponse(HttpStatusCode.OK, nulledteams));
            }
        }
Esempio n. 4
0
        public PropertyBag(InfiniminerGame gameInstance)
        {
            // Initialize our network device.
            NetPeerConfiguration netConfig = new NetPeerConfiguration("InfiniminerPlus");

            netConfig.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);
            netConfig.EnableMessageType(NetIncomingMessageType.ErrorMessage);
            netConfig.EnableMessageType(NetIncomingMessageType.DebugMessage);
            netConfig.EnableMessageType(NetIncomingMessageType.WarningMessage);
            netClient = new NetClient(netConfig);
            //netClient.SimulatedMinimumLatency = 0.1f;
            //netClient.SimulatedLatencyVariance = 0.05f;
            //netClient.SimulatedLoss = 0.1f;
            //netClient.SimulatedDuplicates = 0.05f;
            netClient.Start();

            // Initialize engines.
            Engines = new Dictionary <string, Tuple <IEngine, Type> >();

            RegisterEngine(new BlockEngine(gameInstance), "blockEngine");
            RegisterEngine(new InterfaceEngine(gameInstance), "interfaceEngine");
            RegisterEngine(new PlayerEngine(gameInstance), "playerEngine");
            RegisterEngine(new SkyplaneEngine(gameInstance), "skyplaneEngine");
            RegisterEngine(new ParticleEngine(gameInstance), "particleEngine");

            PlayerContainer          = new PlayerContainer();
            SettingsContainer        = new SettingsContainer();
            ChatContainer            = new ChatContainer();
            TeamContainer            = new TeamContainer();
            TeamContainer.BeaconList = new Dictionary <Vector3, Beacon>();

            PlayerList = new Dictionary <uint, Player>();

            // Create a camera.
            PlayerContainer.PlayerCamera = new Camera(gameInstance.GraphicsDevice);
            UpdateCamera();

            // Load sounds.
            if (!gameInstance.NoSound)
            {
                soundList[InfiniminerSound.DigDirt]         = gameInstance.Content.Load <SoundEffect>("sounds/dig-dirt");
                soundList[InfiniminerSound.DigMetal]        = gameInstance.Content.Load <SoundEffect>("sounds/dig-metal");
                soundList[InfiniminerSound.Ping]            = gameInstance.Content.Load <SoundEffect>("sounds/ping");
                soundList[InfiniminerSound.ConstructionGun] = gameInstance.Content.Load <SoundEffect>("sounds/build");
                soundList[InfiniminerSound.Death]           = gameInstance.Content.Load <SoundEffect>("sounds/death");
                soundList[InfiniminerSound.CashDeposit]     = gameInstance.Content.Load <SoundEffect>("sounds/cash");
                soundList[InfiniminerSound.ClickHigh]       = gameInstance.Content.Load <SoundEffect>("sounds/click-loud");
                soundList[InfiniminerSound.ClickLow]        = gameInstance.Content.Load <SoundEffect>("sounds/click-quiet");
                soundList[InfiniminerSound.GroundHit]       = gameInstance.Content.Load <SoundEffect>("sounds/hitground");
                soundList[InfiniminerSound.Teleporter]      = gameInstance.Content.Load <SoundEffect>("sounds/teleport");
                soundList[InfiniminerSound.Jumpblock]       = gameInstance.Content.Load <SoundEffect>("sounds/jumpblock");
                soundList[InfiniminerSound.Explosion]       = gameInstance.Content.Load <SoundEffect>("sounds/explosion");
                soundList[InfiniminerSound.RadarHigh]       = gameInstance.Content.Load <SoundEffect>("sounds/radar-high");
                soundList[InfiniminerSound.RadarLow]        = gameInstance.Content.Load <SoundEffect>("sounds/radar-low");
                soundList[InfiniminerSound.RadarSwitch]     = gameInstance.Content.Load <SoundEffect>("sounds/switch");
            }
        }
Esempio n. 5
0
        public void TestGetAllTeamsFromDatabase()
        {
            TeamContainer teamContainer = new TeamContainer();
            List <Team>   teams         = new List <Team>();

            teams = teamContainer.GetAllTeams();

            Assert.AreEqual("Ferrari", teams[0].Name);
            Assert.AreEqual("Justin van de laar", teams[0].Director);
            Assert.AreEqual(12, teams.Count);
        }
Esempio n. 6
0
        public void GetATeamFromDatabaseById()
        {
            int id = 1;

            TeamContainer teamContainer = new TeamContainer();
            Team          team          = teamContainer.GetTeam(id);

            Assert.AreEqual("Mercedes", team.Name);
            Assert.AreEqual("Justin Rijgersberg", team.Director);

            id = 0;

            teamContainer = new TeamContainer();
            team          = teamContainer.GetTeam(id);

            Assert.AreEqual("Ferrari", team.Name);
            Assert.AreEqual("Justin van de laar", team.Director);
        }
Esempio n. 7
0
        private void carsControl1_conClick_1(object sender, EventArgs e)
        {
            CarsControl carbt = (CarsControl)sender;

            if (carbt.Clicked || carbt.Entered)
            {
                Teams p = new CONTROLS.Teams()
                {
                    Size     = TeamContainer.Size,
                    Id       = carbt.CarID,
                    CenterId = carbt.CenterID
                };

                TeamContainer.SuspendLayout();
                TeamContainer.Controls.Add(p);
                TeamContainer.ResumeLayout();
            }
            else
            {
                TeamContainer.Controls.Clear();
            }
        }
Esempio n. 8
0
    TeamContainer[] cacheTeams(int teamCount)
    {
        TeamContainer[] tempTeamCache = new TeamContainer[teamCount];
        int             i             = 0;

        //node is the complete team node with all the character ID's in it as children
        //i increments through the temp cache object
        foreach (XmlNode node in teamList)
        {
            //Temporary Team Container, removes null reference issues
            TeamContainer tempTeamContainer = new TeamContainer();
            tempTeamContainer.teamArray = new CharacterContainer[teamSize];
            //Increments through the XML datas child nodes
            for (int j = 0; j < teamSize; j++)
            {
                foreach (CharacterContainer cont in characterCache)
                {
                    CharacterContainer temp = new CharacterContainer();
                    int nodeid;
                    int.TryParse(node.ChildNodes[j].InnerText, out nodeid);
                    //If the IDs match the container object is populated and put in to the temp team container
                    if (cont.id == nodeid)
                    {
                        temp.iconTexture = cont.iconTexture;
                        temp.id          = cont.id;
                        temp.powerClass  = cont.powerClass;
                        tempTeamContainer.teamArray[j] = temp;
                        break;
                    }
                }
            }
            //the teap team container is pushed to the temp team cache, this will happen even if the ID couldn't be found
            //it will add a blank object as if the characters id is -1
            tempTeamCache[i] = tempTeamContainer;
            i++;
        }
        return(tempTeamCache);
    }
Esempio n. 9
0
        // GET: /Team/5?tenant-id
        public HttpResponseMessage Get(string tenant_id, int id)
        {
            Team t = TeamService.GetById(id);

            if (t == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound, "Incorrect team id"));
            }

            else if (t.Owner != tenant_id)
            {
                return(Request.CreateResponse(HttpStatusCode.Forbidden, "You are not allowed, check your tenant id"));
            }

            else
            {
                TeamContainer tc = new TeamContainer();
                tc.TeamID          = t.TeamID;
                tc.TeamName        = t.TeamName;
                tc.TeamDescription = t.TeamDescription;
                return(Request.CreateResponse(HttpStatusCode.OK, tc));
            }
        }
Esempio n. 10
0
 public TechLead(string name, string surname)
     : base(name, surname)
 {
     team = new TeamContainer<Programmer>();
 }
Esempio n. 11
0
 public AnalyticsLead(string name, string surname)
     : base(name, surname)
 {
     team = new TeamContainer<Analyst>();
 }
Esempio n. 12
0
 public QALead(string name, string surname)
     : base(name, surname)
 {
     team = new TeamContainer<Tester>();
 }
Esempio n. 13
0
 public TeamContainerTests()
 {
     container = new TeamContainer();
     team      = new Team("Mercedes");
 }
Esempio n. 14
0
 public Competition(List <Team> LTeams)
 {
     DateOfCreation = DateTime.Now.ToString("D") + " " + DateTime.Now.ToString("H-mm-ss");
     Teams          = new TeamContainer(LTeams);
 }
Esempio n. 15
0
 public Competition()
 {
     //AutoClosingMessageBox.Show("Test","Test", 4000);
     DateOfCreation = DateTime.Now.ToString("D") + " " + DateTime.Now.ToString("H-mm-ss");
     Teams          = new TeamContainer(new List <Team>());
 }