Example #1
0
        public ElementFactory(int initCount, ContentRepository repo,
#if WPF
                              MonoGameControl.
#else
                              Microsoft.Xna.Framework.
#endif
                              Game game, ICamera camera, Func <ContentRepository,
#if WPF
                                                               MonoGameControl.
#else
                                                               Microsoft.Xna.Framework.
#endif
                                                               Game, ICamera, T> creator, ElementManager manager)
        {
            _freeObjects = new Queue <T>();
            _usedObjects = new List <T>();
            _creator     = creator;
            _repo        = repo;
            _game        = game;
            _camera      = camera;
            _manager     = manager;

            for (int i = 0; i < initCount; i++)
            {
                T obj = creator(repo, game, camera);
                obj.Visible = false;
                _freeObjects.Enqueue(obj);
            }
        }
Example #2
0
        public void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(_game.GraphicsDevice);
            _infoPanel   = new InfoPanel(ContentRepository, _screen);

            _music.AddSong("the_lift", ContentRepository.LoadSong("Music/the_lift"));
            _music.AddSoundEffect("explode", ContentRepository.LoadSoundEffect("Sounds/explode"));
            _music.AddSoundEffect("star", ContentRepository.LoadSoundEffect("Sounds/floop"));

            _tile   = ContentRepository.LoadTexture("Textures/tile");
            _effect = ContentRepository.LoadEffect("Effects/Tunnel"
#if ANDROID
                                                   + ".android"
#endif
                                                   );

            _tunnel         = new Tunnel(32, _effect, _tile);
            _player         = new Player(ContentRepository, _game, _camera, _tunnel);
            _player.Visible = false;

            _elemManager = new ElementManager(ContentRepository, _sceneInterface, _game, _camera, _tunnel, _player, _music);
            angleUpdate  = 0;

            _font[0]      = ContentRepository.LoadFont("Fonts/Ubuntu12");
            _font[1]      = ContentRepository.LoadFont("Fonts/Ubuntu24");
            _font[2]      = ContentRepository.LoadFont("Fonts/Ubuntu36");
            _font[3]      = ContentRepository.LoadFont("Fonts/Ubuntu48");
            _font[4]      = ContentRepository.LoadFont("Fonts/Ubuntu64");
            _fontIcons[0] = ContentRepository.LoadFont("Fonts/Awesome12");
            _fontIcons[1] = ContentRepository.LoadFont("Fonts/Awesome24");
            _fontIcons[2] = ContentRepository.LoadFont("Fonts/Awesome36");
            _fontIcons[3] = ContentRepository.LoadFont("Fonts/Awesome48");
            _fontIcons[4] = ContentRepository.LoadFont("Fonts/Awesome64");
        }
Example #3
0
        // GET: Admin/Delete/5
        public ActionResult DeletePersoon(int id)
        {
            IElementManager elementManager = new ElementManager();
            var             persoon        = elementManager.getElementById(id);

            return(View(persoon));
        }
Example #4
0
        // GET: Admin/LijsUsers
        public ActionResult LijstThemas()
        {
            IElementManager elementManager = new ElementManager();
            List <Thema>    themas         = elementManager.getAllThemas(Deelplatform);

            return(View(themas));
        }
Example #5
0
        public ActionResult EditPersoon(int id, Persoon persoon)
        {
            IElementManager elementManager = new ElementManager();

            elementManager.updatePersoon(persoon);
            return(RedirectToAction("LijstPersonen"));
        }
Example #6
0
        // GET: Admin/LijsUsers
        public ActionResult LijstPersonen()
        {
            IElementManager elementManager = new ElementManager();
            var             personen       = elementManager.getAllPersonen(Deelplatform);

            return(View(personen));
        }
        public ActionResult Search(string searchstring = "test")
        {
            IElementManager elementManager = new ElementManager();

            if (searchstring == "test")
            {
                List <Element> leeg = new List <Element>();
                ViewBag.Lijst = leeg;
                return(View());
            }
            List <Element> elementen = elementManager.getAllElementen(Deelplatform).Where(e => e.Naam.ToLower().Contains(searchstring.ToLower())).ToList();

            elementen = elementen.OrderBy(o => o.Trend).ToList();
            List <Persoon> personen = elementManager.getAllPersonen(Deelplatform).Where(e => e.Organisatie.Naam.ToLower().Contains(searchstring.ToLower())).ToList();

            personen = personen.OrderBy(o => o.Trend).ToList();
            elementen.AddRange(personen);
            List <Thema> themas = elementManager.getAllThemas(Deelplatform);

            if (elementen.Count() > 5)
            {
                elementen = elementen.GetRange(0, 5);
            }
            List <string> lijst = new List <string>();

            foreach (Element element in elementen)
            {
                lijst.Add(element.Naam);
            }
            ViewBag.Lijst = lijst;
            return(Json(lijst));
        }
Example #8
0
        // GET: Admin/Details/5
        public ActionResult DetailsThema(int id)
        {
            IElementManager elementManager = new ElementManager();
            Thema           thema          = (Thema)elementManager.getElementById(id);

            return(View(thema));
        }
Example #9
0
        private void horizontalCenterButton_Click(object sender, EventArgs e)
        {
            if (!CheckAllSelectedElementsEnabled(true))
            {
                return;
            }

            var listSelectedElements = ElementManager.Instance.SelectedElements;

            if (listSelectedElements == null || listSelectedElements.Count == 0)
            {
                return;
            }
            var zLayout = LayoutManager.Instance.ActiveLayout;
            var dictionaryOriginalPositions = ElementManager.Instance.GetUndoRedoPoints();

            foreach (var zElement in ElementManager.Instance.SelectedElements)
            {
                zElement.x = (zLayout.width - zElement.width) / 2;
            }

            ElementManager.ConfigureUserAction(dictionaryOriginalPositions,
                                               ElementManager.Instance.GetUndoRedoPoints());
            ElementManager.Instance.FireElementBoundsUpdateEvent();
        }
Example #10
0
    override public void LateUpdate()
    {
        foreach (LineSelectorManager ls in transform.GetComponentsInChildren <LineSelectorManager>())
        {
            if (ls.isSelected)
            {
                foreach (GameObject go in doublets)
                {
                    ElementManager em = go.GetComponent <ElementManager>();
                    if (em.isSelected)
                    {
                        if (em.AbsorptionLine != ls.gameObject)
                        {
                            em.IdentifyAbsoptionLine(ls.gameObject);
                        }
                        else
                        {
                            em.IdentifyAbsoptionLine(null);
                        }

                        em.unSelectElement();
                    }
                }
            }
        }
    }
Example #11
0
        // GET: Admin/Delete/5
        public ActionResult DeleteOrganisatie(int id)
        {
            IElementManager elementManager = new ElementManager();
            var             organisatie    = elementManager.getElementById(id);

            return(View(organisatie));
        }
Example #12
0
        public override void PostInitialize()
        {
            ElementManager.AddBulkTags(new Dictionary <Element, Tag[]>()
            {
                {
                    // Sand is a powder
                    ElementLoader.FindElementByHash(SimHashes.Sand),
                    new Tag[] { Tags.Powder }
                },
                {
                    // Regolith is a silt
                    ElementLoader.FindElementByHash(SimHashes.Regolith),
                    new Tag[] { Tags.Silt }
                },
                {
                    // Steel is an alloy
                    ElementLoader.FindElementByHash(SimHashes.Steel),
                    new Tag[] { GameTags.Alloy }
                },
                {
                    // Thermium is an alloy
                    ElementLoader.FindElementByHash(SimHashes.TempConductorSolid),
                    new Tag[] { GameTags.Alloy }
                }
            });

            ElementLoader.FindElementByHash(SimHashes.Diamond).tag = Tags.Gem;
            ElementLoader.FindElementByHash(SimHashes.Salt).tag    = Tags.Silt;
        }
    /// <summary>
    /// allows this window to be called while providing the necessary information
    /// </summary>
    /// <param name="emanager">the Element Manager that is being used</param>
    /// <param name="row">the index of the element that we are modifying</param>
    /// <param name="targetElement">the element that can be found in the effectiveness of the element we are modifying</param>
    public static void ShowWindow(ElementManager emanager, int row, string targetElement)
    {
        //Show existing window instance. If one doesn't exist, make one.
        EditorWindow.GetWindow(typeof(EditingEffectivenessWindow));

        //pass over the information
        EManager      = emanager;
        Row           = row;
        TargetElement = targetElement;

        //find which column the element's infrmation is on
        bool foundElement = false;

        for (int i = 0; i < EManager.ElementCount && !foundElement; i++)
        {
            if (EManager.Elements[row].EffectivenessOnElement[i].element.elementName == TargetElement)
            {
                Col          = i;
                foundElement = true;
            }
        }

        //have the windows 'new' multiplyer start as the current multiplyer
        newMultiplyer = CurrentMultiplyer;
    }
Example #14
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (Elementen == null)
            {
                Elementen = new List <Element>();
            }
            var segments = HttpContext.Request.Url.Segments;

            if (!(segments.Length <= 1))
            {
                BaseController.deelplatformURL = HttpContext.Request.Url.Segments[1].Trim('/');
                IPlatformManager platformManager = new PlatformManager();
                this.Deelplatform    = platformManager.getDeelplatformByNaam(deelplatformURL);
                ViewBag.Deelplatform = deelplatformURL;
                IElementManager elementManager      = new ElementManager();
                Deelplatform    elementDeelplatform = null;
                if (Elementen.FirstOrDefault() != null)
                {
                    elementDeelplatform = Elementen.FirstOrDefault().Deelplatform;
                }

                if (Deelplatform != null && (elementDeelplatform == null || elementDeelplatform.Naam != Deelplatform.Naam))
                {
                    Elementen = elementManager.getAllElementen(Deelplatform);
                }
            }
            base.OnActionExecuting(filterContext);
        }
Example #15
0
    public int[] GetProvinceIdVals(Vector3 offset)
    {
        ElementManager mgr = GetComponent <ElementManager>();

        province_id_map_container = new GameObject("ProvinceIdMapContainer");
        Transform tr = province_id_map_container.transform;

        foreach (var prov in mgr.m_provinces)
        {
            MakeProvinceIdTexture(prov, offset, tr);
        }

        CaptureCam.s_capture_cam.transform.position += offset;

        CaptureCam.s_capture_cam.Camera.Render();

        CaptureCam.s_capture_cam.transform.position -= offset;
        var       tex = mgr.Texture;
        Texture2D t   = new Texture2D(tex.width, tex.height, TextureFormat.RGB24, false);

        t.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0);


        Color32[] pixels = t.GetPixels32();
        Destroy(t);
        Destroy(province_id_map_container);

        int[] province_ids = new int[pixels.Length];
        for (int i = 0; i < pixels.Length; ++i)
        {
            Color32 p = pixels[i];
            province_ids[i] = p.b + p.g * 256;
        }
        return(province_ids);
    }
 void DealDamage(GameObject other)
 {
     if (other.GetComponent <Health>())
     {
         if (other.tag == "Player" && other.GetComponent <ElementManager>())
         {
             ElementManager em   = other.GetComponent <ElementManager>();
             bool           flag = false;
             foreach (string s in ElementalException)
             {
                 if (s == em.elementalType)
                 {
                     flag = true;
                     break;
                 }
             }
             if (!flag)
             {
                 Health h = other.GetComponent <Health>();
                 h.health -= damage;
             }
         }
         else
         {
             Health h = other.GetComponent <Health>();
             h.health -= damage;
         }
     }
 }
Example #17
0
        public void ExportPersonenToExcel()
        {
            IElementManager elementManager = new ElementManager();

            List <Persoon> personen = elementManager.getAllPersonen(Deelplatform);

            var grid = new GridView();

            grid.DataSource = from data in personen
                              select new
            {
                Id             = data.Id,
                Naam           = data.Naam,
                Trend          = data.Trend,
                TrendingPlaats = data.TrendingPlaats,
                Organisatie    = data.Organisatie,
                District       = data.District,
                Level          = data.Level,
                Gender         = data.Gender,
                Twitter        = data.Twitter,
                Site           = data.Site,
                DateOfBirth    = data.DateOfBirth,
                Facebook       = data.Facebook,
                Postal_code    = data.Postal_code,
                Position       = data.Position,
                Organisation   = data.Organisation,
                Town           = data.Town,
                Posts          = data.Posts
            };
            ExportData(grid);
        }
Example #18
0
        /// <summary>
        /// Creates a windowsform control
        /// </summary>
        /// <param name="widget">Widget to create control from</param>
        /// <returns>Windows forms control</returns>
        public override Control CreateElement(ElementManager widget, WindowsStyleProperties style)
        {
            // Create main control with style
            Control result = CreateStyledBase(style);

            switch (widget)
            {
            case IntQuestionManager intWidget:
                CreateIntWidget(intWidget, style, ref result);
                break;

            case BoolQuestionManager boolWidget:
                CreateBoolWidget(boolWidget, style, ref result);
                break;

            case StringQuestionManager stringWidget:
                CreateStringWidget(stringWidget, style, ref result);
                break;

            case MoneyQuestionManager moneyWidget:
                CreateMoneyWidget(moneyWidget, style, ref result);
                break;
            }

            // Resize main control
            result.Height = result.Controls[0].Height + result.Controls[0].Height;
            return(result);
        }
Example #19
0
        private void RemoveRowViewAt(int index)
        {
            var rowView = (RowView)Elements[index];

            ElementManager.Cleanup(rowView.RowPresenter);
            RemoveAt(index);
        }
Example #20
0
        /// <summary>
        /// Shows specific widget
        /// </summary>
        /// <param name="widget">Widget to show</param>
        /// <param name="position">X position to show widget</param>
        /// <returns></returns>
        public override float ShowWidget(ElementManager widget, WindowsStyleProperties style)
        {
            // Create control
            Control control = null;

            if (ElementIndex.ContainsKey(widget.Identifier))
            {
                control          = ElementIndex[widget.Identifier];
                control.Location = new Point(0, style.YPosition);
            }
            else
            {
                control = CreateElement(widget, style);
            }

            // Calculate bottom position
            int newBottom = control.Height + control.Location.Y;

            // Check if form has enough space, extend if needed
            if (_widgetContainer.Height < newBottom)
            {
                _widgetContainer.Height = newBottom + (int)InitialPosition;
            }

            // Add control to form
            _widgetContainer.Controls.Add(control);

            // Return bottom
            return(newBottom);
        }
Example #21
0
 // Temp.
 private void Setup()
 {
     _elementManager = FindObjectOfType <ElementManager>();
     _as             = GetComponent <AudioSource>();
     _colourMaster   = new ColourMaster();
     _startColours   = _colourMaster.GetColours(_renderersToFade);
 }
Example #22
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #23
0
        public static ElementType ElementToEnum(ElementManager manager)
        {
            switch (manager)
            {
            case BoolQuestionManager boolQuestion:
                return(ElementType.Bool);

            case IntQuestionManager intQuestion:
                return(ElementType.Int);

            case MoneyQuestionManager moneyQuestion:
                return(ElementType.Money);

            case StringQuestionManager stringQuestion:
                return(ElementType.Sting);

            case FormManager form:
                return(ElementType.Form);

            case PageManager page:
                return(ElementType.Page);

            case SectionManager section:
                return(ElementType.Section);
            }
            throw new NotImplementedException();
        }
 // Use this for initialization
 void Awake()
 {
     playersRigidBody            = GetComponent <Rigidbody>();
     interactionIndicatorUI      = interactionIndicatorUIHolder.GetComponent <Image>();
     interactionIndicatorToolTip = interactionIndicatorToolTipHolder.GetComponent <Text>();
     elementManager = elementManagerHolder.GetComponent <ElementManager>();
 }
Example #25
0
    public void selectElement()
    {
        //if (inReaction) return; //Already part of a reaction

        bool s = isSelected;

        GameObject[] goSameType;

        if (!multiSelectable)
        {
            goSameType = GameObject.FindGameObjectsWithTag(gameObject.tag); // Find all GO with same tag

            foreach (GameObject go in goSameType)                           // and unselect them
            {
                ElementManager el = go.GetComponent <ElementManager>();
                if (el == null)
                {
                    Debug.Log(go.name);
                }
                else
                {
                    //go.GetComponent<ElementManager>().isSelected = false;
                    go.GetComponent <ElementManager>().unSelectElement();
                }
            }
        }

        isSelected = !s; //toggle selection
        GetComponent <Animator>().SetBool("selected", isSelected);
    }
Example #26
0
    public bool GainElement(ElementType elementType)
    {
        ElementType newElement = (this.element == null) ? elementType : ElementManager.GetCombinationElement(elementType, this.element.elementType);

        Debug.Log(newElement);

        if (newElement == ElementType.None)
        {
            ClearElement();
            return(true);
        }
        else if (this.element == null || newElement != this.element.elementType)
        {
            ClearElement();
            LevelManager.CreateElementAtTile(this, newElement);

            if (this.element.elementType == ElementType.Water)
            {
                this.element.GetComponent <Water> ().destroyTileOnLose = false;
            }

            setMaterial();
            return(true);
        }

        return(false);
    }
        /// <summary>
        /// Creates view element
        /// </summary>
        /// <param name="widget">Widget to show</param>
        /// <param name="style">Style of widget</param>
        /// <returns>View element</returns>
        protected T CreateElement(ElementManager widget, Y style)
        {
            T element = _elementFactory.CreateElement(widget, style);

            ElementIndex.Add(widget.Identifier, element);
            return(element);
        }
Example #28
0
        public ActionResult EditOrganisatie(int id, Organisatie organisatie)
        {
            IElementManager elementManager = new ElementManager();

            elementManager.updateOrganisatie(organisatie);

            return(RedirectToAction("LijstOrganisaties"));
        }
Example #29
0
        public ActionResult EditThema(int id, Thema thema)
        {
            IElementManager elementManager = new ElementManager();

            elementManager.updateThema(thema);

            return(RedirectToAction("LijstThemas"));
        }
Example #30
0
        public ActionResult DeleteOrganisatie(int id, FormCollection collection)
        {
            IElementManager elementManager = new ElementManager();
            Organisatie     organisatie    = (Organisatie)elementManager.getElementById(id);

            elementManager.deleteOrganisatie(organisatie);
            return(RedirectToAction("LijstOrganisaties"));
        }
Example #31
0
	/// <summary>
	/// NETWORKED: Creates the shield.
	/// </summary>
	/// <returns>The shield.</returns>
	/// <param name="element">Element.</param>

	//Create a shield with element pool from player when player demands it
	public ShieldManager CreateShield(ElementManager element){
		if (element != null) {
			ShieldManager shield = new ShieldManager();
			shield.id = shieldId;
			shieldId++;
			ElementManager basis = element;
			GameObject g;
			PhotonView currentPhotonView;
			ShieldObserver shieldObserver;
			if (shieldBook.TryGetValue (basis.elementType.ToString() + "Shield", out g)){


//				CLEANUPCOMPONENTS
//				ShieldObserver[] so = g.GetComponents<ShieldObserver>();
//				for (int i = 0; i < so.Length; i++) {
//					DestroyImmediate(so[i], true);
//				}
//				
//				PhotonView[] pv = g.GetComponents<PhotonView>();
//				for (int i = 0; i < pv.Length; i++) {
//					DestroyImmediate (pv[i], true);
//				}

				currentPhotonView = g.GetComponent<PhotonView>();

				if(currentPhotonView == null){
					currentPhotonView = g.AddComponent<PhotonView>();
				}

				shieldObserver = g.GetComponent<ShieldObserver>();
				if (shieldObserver == null){
					shieldObserver = g.AddComponent<ShieldObserver>();
				}
				
//				Debug.Log("currentPhotonView Count: " + currentPhotonView.ObservedComponents.Count);
				currentPhotonView.ObservedComponents.Clear();
				if(currentPhotonView.ObservedComponents!=null && currentPhotonView.ObservedComponents.Count==0)
				{
					currentPhotonView.ObservedComponents.Add(shieldObserver);
//					currentPhotonView.ObservedComponents[0] = shieldObserver;
//					currentPhotonView.ObservedComponents.
				}

				// Instantiate on network (call current element shield from within shield folder)
				shield.instance = (GameObject) PhotonNetwork.Instantiate(
					"Shields/"+g.name, basis.instance.transform.position, transform.rotation ,0);

				shield.elementType = basis.elementType;
				shield.Setup();
				shield.shieldElement.elementType = basis.elementType;
			} 
			
			return shield;
		} else {
			//buzz sound
			return null;
		}
	}
Example #32
0
	void Start () {
		elementPool = new List<ElementManager>();
		spellPool = new List<SpellManager>();
		shieldPool = new List<ShieldManager>();
		leftElement = null;
		rightElement = null;

		handLeft = 2;
		handRight = 2;
	}
Example #33
0
	//Create an element
	public ElementManager GetElementOfType(elementType t, int handNumber){
		ElementManager element = null;
		GameObject g;
		HandModel[] hands = GameManager.instance.movementManager.handController.GetAllPhysicsHands();

		if (elementBook.TryGetValue (t.ToString (), out g)) {
			element = new ElementManager ();
			element.instance = (GameObject)Instantiate (g, hands[handNumber].GetPalmPosition(), transform.rotation);
			element.elementType = t;
			element.Setup ();
			element.elementMovement.handNumber = handNumber;
		} else {
			print ("Could not find element: " + t.ToString());
		}

		return element;
	}
Example #34
0
	//Create a shield with element pool from player when player demands it
	public ShieldManager CreateShield2(ElementManager element){
		if (element != null) {
			ShieldManager shield = new ShieldManager();
			ElementManager basis = element;
			GameObject g;
			if (shieldBook.TryGetValue (basis.elementType.ToString() + "Shield", out g)){
				shield.instance = (GameObject)Instantiate(g, basis.instance.transform.position, transform.rotation);
				shield.elementType = basis.elementType;
				shield.Setup();
				shield.shieldElement.elementType = basis.elementType;
			} 

			return shield;
		} else {
			//buzz sound
			return null;
		}
	}
		public FourZeroFourManager(
			ElementManager elementManager)
			: base(elementManager)
		{
		}
Example #36
0
	//Combine elements from pool
	public void Combine(){
		if (elementPool.Count >  1){
			//Add Elements to combine
			ElementManager element = ElementSpawner.instance.CombineElements(elementPool);
			if (element != null)
			{
				EmptyElementPool();
				elementPool.Add(element);

				HandModel[] hands = GameManager.instance.movementManager.handController.GetAllPhysicsHands();

				if (hands[handLeft].gameObject.GetComponentInChildren<HandInteraction>()._magnitude < hands[handRight].gameObject.GetComponentInChildren<HandInteraction>()._magnitude){
					handRightSlot = false;
					leftElement = element;
				}else{
					handLeftSlot = false;
					rightElement = element;
				}
			}
		}
	}
Example #37
0
	//Create a spell with elements from pool
	public void ExecuteShield(ElementManager elementManager){

//		ExecuteSpell (0);
//		return;
//		// NO HE DIDNT : Workaround

		ShieldManager shield = ShieldSpawner.instance.CreateShield (elementManager);
		if (shield != null) {

			shieldPool.Add(shield);
			EmptyElementPool();
			handLeftSlot = false;
			handRightSlot = false;
		}
	}
Example #38
0
 void Awake()
 {
     instance = this;
     preferArr = new ArrayList();
 }
Example #39
0
	//Add summoned element to element pool
	public void AddElementToPool(elementType t, int handNumber)
	{
		ElementManager element = ElementSpawner.instance.GetElementOfType (t, handNumber);
		elementPool.Add (element);

		HandModel[] hands = GameManager.instance.movementManager.handController.GetAllPhysicsHands();

		if (hands[handNumber].GetLeapHand().IsLeft) {
			leftElement = element;
		} else if (hands[handNumber].GetLeapHand().IsRight) {
			rightElement = element;
		}
	}
Example #40
0
	public ElementManager CombineElements(List<ElementManager> list){
		ElementManager element = null;
		GameObject g;
		int handNumber;
		HandModel[] hands = GameManager.instance.movementManager.handController.GetAllPhysicsHands();
		float speed0 = list[0].instance.GetComponent<ElementMovement>()._magnitude;
		float speed1 = list[1].instance.GetComponent<ElementMovement>()._magnitude;


		if(speed0 < speed1){
			basisNumber = 0; 
			otherNumber = 1;
			handNumber = list[0].instance.GetComponent<ElementMovement>().handNumber;
		}else{
			basisNumber = 1;
			otherNumber = 0;
			handNumber = list[1].instance.GetComponent<ElementMovement>().handNumber;
		}

		elementType basis = list[basisNumber].elementType;
		elementType other = list[otherNumber].elementType;

		string elementTypeCombined = basis.ToString() + other.ToString();
		
		if (elementBook.TryGetValue (elementTypeCombined, out g)) {
			element = new ElementManager ();
			element.instance = (GameObject)Instantiate (g, hands[handNumber].GetPalmPosition(), transform.rotation);
			switch (basis){
			case elementType.Fire:
				switch (other){
				case elementType.Air:
					basis = elementType.FireAir;
					break;
				case elementType.Earth:
					basis = elementType.FireEarth;
					break;
				}
				break;
			case elementType.Air:
				switch (other){
				case elementType.Water:
					basis = elementType.AirWater;
					break;
				case elementType.Fire:
					basis = elementType.FireAir;
					break;
				}
				break;
			case elementType.Water:
				switch (other){
				case elementType.Air:
					basis = elementType.WaterAir;
					break;
				case elementType.Earth:
					basis = elementType.WaterEarth;
					break;
				}
				break;
			case elementType.Earth:
				switch (other){
				case elementType.Fire:
					basis = elementType.EarthFire;
					break;
				case elementType.Water:
					basis = elementType.EarthWater;
					break;
				}
				break;
			}
			element.elementType = basis;
			element.Setup ();
			element.elementMovement.handNumber = handNumber;
		} else {
			print ("Could not find element");
		}
		return element;
	}
Example #41
0
        public static void LoadSystemConfig()
        {
            Execution.initInstrumentation();
            DataFlow = new DataFlowManager();
            Elements = new ElementManager();
            Nodes = new NodeManager();
            OutputControllers = new OutputControllerManager(
                new ControllerLinkingManagement<OutputController>(),
                new OutputDeviceCollection<OutputController>(),
                new OutputDeviceExecution<OutputController>());
            SmartOutputControllers = new SmartOutputControllerManager(
                new ControllerLinkingManagement<SmartOutputController>(),
                new OutputDeviceCollection<SmartOutputController>(),
                new OutputDeviceExecution<SmartOutputController>());
            Previews = new PreviewManager(
                new OutputDeviceCollection<OutputPreview>(),
                new OutputDeviceExecution<OutputPreview>());
            Contexts = new ContextManager();
            Filters = new FilterManager(DataFlow);
            ControllerLinking = new ControllerLinker();
            ControllerManagement = new ControllerFacade();
            ControllerManagement.AddParticipant(OutputControllers);
            ControllerManagement.AddParticipant(SmartOutputControllers);
            OutputDeviceManagement = new OutputDeviceFacade();
            OutputDeviceManagement.AddParticipant(OutputControllers);
            OutputDeviceManagement.AddParticipant(SmartOutputControllers);
            OutputDeviceManagement.AddParticipant(Previews);

            // Load system data in order of dependency.
            // The system data generally resides in the data branch, but it
            // may not be in the case of an alternate context.
            string systemDataPath = _GetSystemDataPath();
            // Load module data before system config.
            // System config creates objects that use modules that have data in the store.
            ModuleStore = _LoadModuleStore(systemDataPath) ?? new ModuleStore();
            SystemConfig = _LoadSystemConfig(systemDataPath) ?? new SystemConfig();

            Elements.AddElements(SystemConfig.Elements);
            Nodes.AddNodes(SystemConfig.Nodes);
            OutputControllers.AddRange(SystemConfig.OutputControllers.Cast<OutputController>());
            SmartOutputControllers.AddRange(SystemConfig.SmartOutputControllers.Cast<SmartOutputController>());
            Previews.AddRange(SystemConfig.Previews.Cast<OutputPreview>());
            ControllerLinking.AddRange(SystemConfig.ControllerLinking);
            Filters.AddRange(SystemConfig.Filters);

            DataFlow.Initialize(SystemConfig.DataFlow);
        }
Example #42
0
	private void initialize()
	{
		_elementManager = new ElementManager();
	}