public SpecialAreaGenerator(IAreaPercentileSelector areaPercentileSelector, IPercentileSelector percentileSelector, PoolGenerator poolGenerator, AreaGenerator caveGenerator) { this.areaPercentileSelector = areaPercentileSelector; this.percentileSelector = percentileSelector; this.poolGenerator = poolGenerator; this.caveGenerator = caveGenerator; }
public CaveGenerator(IAreaPercentileSelector areaPercentileSelector, PoolGenerator poolGenerator, IPercentileSelector percentileSelector, IEncounterGenerator encounterGenerator) { this.areaPercentileSelector = areaPercentileSelector; this.poolGenerator = poolGenerator; this.percentileSelector = percentileSelector; this.encounterGenerator = encounterGenerator; }
public static void RunStoreToConverters() { PoolGenerator gs = new PoolGenerator("GeneratorS"); PoolGenerator gc1 = new PoolGenerator("GeneratorC1"); PoolGenerator gc2 = new PoolGenerator("GeneratorC2"); ListStorage s = new ListStorage(); s.Enable(); s.Name = "Store"; MathConverter c1 = new MathConverter(); c1.Enable(); c1.Name = "Calculator1"; MathConverter c2 = new MathConverter(); c2.Enable(); c2.Name = "Calculator2"; Builder.DataConnect(s, c1); Builder.DataConnect(s, c2); Builder.ActivationConnect(gs, s); Builder.ActivationConnect(gc2, c1); Builder.ActivationConnect(gc2, c2); gs.Enable(); gc1.Enable(); gc2.Enable(); }
public override void Build() { generator = new PoolGenerator("Main"); supplier = new EmptyCommandsSupplier("Supplier"); storage = new EmptyCommandsStorage("Storage"); Builder.DataConnect(supplier, storage); Builder.PowerConnect(generator, supplier); Builder.PowerConnect(generator, storage); }
void Awake() { if (mInstance != null && mInstance != this) { Debug.LogWarning("PoolGenerator - we were instantiating a second copy of PoolGenerator, so destroying this instance", this); DestroyImmediate(this.gameObject, true); return; } mInstance = this; DontDestroyOnLoad(this); Initialization(); }
public TestComponent() { PoolGenerator pg1 = new PoolGenerator("Generator1"); PoolGenerator pg2 = new PoolGenerator("Generator2"); PoolGenerator pg3 = new PoolGenerator("Generator3"); PoolGenerator pg4 = new PoolGenerator("Generator4"); PoolGenerator pg5 = new PoolGenerator("Generator5"); PoolGenerator pg6 = new PoolGenerator("Generator6"); PoolGenerator pg7 = new PoolGenerator("Generator7"); PoolGenerator pg8 = new PoolGenerator("Generator8"); TestConverter tc1 = new TestConverter("Converter1"); TestConverter tc2 = new TestConverter("Converter2"); TestConverter tc3 = new TestConverter("Converter3"); TestConverter tc4 = new TestConverter("Converter4"); TestConverter tc5 = new TestConverter("Converter5"); TestConverter tc6 = new TestConverter("Converter6"); TestConverter tc7 = new TestConverter("Converter7"); TestConverter tc8 = new TestConverter("Converter8"); Builders.Builder.PowerConnect(pg1, tc1); Builders.Builder.PowerConnect(pg2, tc2); Builders.Builder.PowerConnect(pg3, tc3); Builders.Builder.PowerConnect(pg4, tc4); Builders.Builder.PowerConnect(pg5, tc5); Builders.Builder.PowerConnect(pg6, tc6); Builders.Builder.PowerConnect(pg7, tc7); Builders.Builder.PowerConnect(pg8, tc8); tc1.Enable(); tc2.Enable(); tc3.Enable(); tc4.Enable(); tc5.Enable(); tc6.Enable(); tc7.Enable(); tc8.Enable(); pg1.Enable(); pg2.Enable(); pg3.Enable(); pg4.Enable(); pg5.Enable(); pg6.Enable(); pg7.Enable(); pg8.Enable(); }
public static void RunStoreToConvertersToStore() { PoolGenerator gs1 = new PoolGenerator("GeneratorS1"); PoolGenerator gc1 = new PoolGenerator("GeneratorC1"); PoolGenerator gc2 = new PoolGenerator("GeneratorC2"); PoolGenerator gs2 = new PoolGenerator("GeneratorS2"); ListStorage s1 = new ListStorage(); s1.Enable(); s1.Name = "Store1"; MathConverter c1 = new MathConverter(); c1.Enable(); c1.Name = "Calculator1"; MathConverter c2 = new MathConverter(); c2.Enable(); c2.Name = "Calculator2"; ListStorage s2 = new ListStorage(); s2.Enable(); s2.Name = "Store2"; Builder.DataConnect(s1, c1); Builder.DataConnect(s1, c2); Builder.DataConnect(c1, s2); Builder.DataConnect(c2, s2); Builder.ActivationConnect(gs1, s1); Builder.ActivationConnect(gs2, s2); Builder.ActivationConnect(gc1, c1); Builder.ActivationConnect(gc2, c2); gc1.Enable(); gc2.Enable(); gs1.Enable(); gs2.Enable(); }
public static void RunStoreToConverter() { PoolGenerator gs = new PoolGenerator("GeneratorS"); PoolGenerator gc = new PoolGenerator("GeneratorC"); ListStorage s = new ListStorage(); s.Enable(); s.Name = "Store"; MathConverter c = new MathConverter(); c.Enable(); c.Name = "Calculator"; Builder.DataConnect(s, c); Builder.ActivationConnect(gs, s); Builder.ActivationConnect(gc, c); gs.Enable(); gc.Enable(); }
void Awake() { transform.parent = GameObject.Find ("MainNode").transform; transform.localScale = Vector3.one; goParent3DPosition = new GameObject(); //goParent3DPosition.transform.parent = GameObject.Find ("MainNode").transform; goParent3DPosition.name = "3Dposition_" + name; goBloc = GameObject.Instantiate(Resources.Load("GRI181")) as GameObject; goBloc.transform.parent = goParent3DPosition.transform; goBloc.GetComponent<Renderer>().enabled = false; goBloc.name = "GRI181"; foreach(Transform child in goBloc.transform) { child.gameObject.layer = 14; // underwater if(child.GetComponent<Renderer>()) { child.GetComponent<Renderer>().enabled = false; } } _poolGen = new PoolGenerator (gameObject); if (pointsData.Length > 0) { // pointsData = MirrorX(pointsData); _polygon = new Polygon (pointsData); if (!_IsGenerated) { _IsGenerated = true; _pointsDataBackup = new Point2Data[pointsData.Length]; _polygon.CopyPoint2DataTo (_pointsDataBackup); _poolGen.Generate (_polygon); _rimCount = _poolGen.GetRimCount (); DesignerDesjoyaux fb = gameObject.AddComponent<DesignerDesjoyaux> (); fb.gofiltrationBlock = goBloc; fb.poolDesigner = this; Function_hideObject sidewalkHider = gameObject.AddComponent<Function_hideObject> (); sidewalkHider._nameObjectToHide = "plage"; sidewalkHider._strObjectToHide = "plage"; Function_hideObject rimHider = gameObject.AddComponent<Function_hideObject> (); rimHider.id = 1; rimHider._nameObjectToHide = "margelle"; rimHider._strObjectToHide = "margelle"; rimHider._hide = false; rimHider.SetObjectToHide (_poolGen.GetRimObjects ()); gameObject.AddComponent<Function_PoolInitializer> (); //StartCoroutine (Generate ()); } else { // copie _isLoading = true; StartCoroutine (Generate (_polygon)); } } else { _IsGenerated = true; _polygon = new Polygon (); DesignerDesjoyaux fb = gameObject.AddComponent<DesignerDesjoyaux> (); fb.gofiltrationBlock = goBloc; fb.poolDesigner = this; Function_hideObject sidewalkHide = gameObject.AddComponent<Function_hideObject> (); sidewalkHide._nameObjectToHide = "plage"; sidewalkHide._strObjectToHide = "plage"; Function_hideObject rimHider = gameObject.AddComponent<Function_hideObject> (); rimHider.id = 1; rimHider._nameObjectToHide = "margelle"; rimHider._strObjectToHide = "margelle"; rimHider._hide = false; rimHider.SetObjectToHide (_poolGen.GetRimObjects ()); gameObject.AddComponent<Function_PoolInitializer> (); //StartCoroutine (WaitForGameobjectReadyToDoAction ()); } init3DPoints(); nextCurrentStairwayID(pointsData); savedPointsData = new Point2Data[pointsData.Length]; for(int j = 0; j < pointsData.Length; j++) { savedPointsData[j] = pointsData[j]; } if(listDoubleV3.Count > 0) { idDoubleV3 = 0; v3positionBloc = listDoubleV3[0].v3start; goBloc.transform.position = v3positionBloc; moveBloc(); } else { idDoubleV3 = -1; } }
void Awake() { transform.parent = GameObject.Find ("MainNode").transform; if(_uiName != null) { setUI ((FunctionUI_OS3D)GameObject.Find ("MainScene").GetComponent ("PoolUIv2")); // setUI ((FunctionUI_OS3D)GameObject.Find ("MainScene").GetComponent ("PoolDesignerUI")); } transform.localScale = Vector3.one; _poolGen = new PoolGenerator (gameObject); if (pointsData.Length > 0) { // pointsData = MirrorX(pointsData); _polygon = new Polygon (pointsData); if (!_IsGenerated) { _IsGenerated = true; _pointsDataBackup = new Point2Data[pointsData.Length]; _polygon.CopyPoint2DataTo (_pointsDataBackup); _poolGen.Generate (_polygon); _rimCount = _poolGen.GetRimCount (); Function_hideObject sidewalkHider = gameObject.AddComponent<Function_hideObject> (); sidewalkHider._nameObjectToHide = "plage"; sidewalkHider._strObjectToHide = "plage"; Function_hideObject rimHider = gameObject.AddComponent<Function_hideObject> (); rimHider.id = 1; rimHider._nameObjectToHide = "margelle"; rimHider._strObjectToHide = "margelle"; rimHider._hide = false; rimHider.SetObjectToHide (_poolGen.GetRimObjects ()); gameObject.AddComponent<Function_PoolInitializer> (); //StartCoroutine (Generate ()); } else { // copie _isLoading = true; StartCoroutine (Generate (_polygon)); } } else { _IsGenerated = true; _polygon = new Polygon (); Function_hideObject sidewalkHide = gameObject.AddComponent<Function_hideObject> (); sidewalkHide._nameObjectToHide = "plage"; sidewalkHide._strObjectToHide = "plage"; Function_hideObject rimHider = gameObject.AddComponent<Function_hideObject> (); rimHider.id = 1; rimHider._nameObjectToHide = "margelle"; rimHider._strObjectToHide = "margelle"; rimHider._hide = false; rimHider.SetObjectToHide (_poolGen.GetRimObjects ()); gameObject.AddComponent<Function_PoolInitializer> (); StartCoroutine (WaitForGameobjectReadyToDoAction ()); } //gameObject.GetComponent ("ObjData").SendMessage ("updateSpecFcns"); //transform.localPosition = currentPosition; }
public void Setup() { mockPercentileSelector = new Mock<IPercentileSelector>(); mockEncounterGenerator = new Mock<IEncounterGenerator>(); mockTreasureGenerator = new Mock<ITreasureGenerator>(); poolGenerator = new DomainPoolGenerator(mockPercentileSelector.Object, mockEncounterGenerator.Object, mockTreasureGenerator.Object); selectedPool = string.Empty; encounter = new Encounter(); treasure = new Treasure(); mockPercentileSelector.Setup(s => s.SelectFrom(TableNameConstants.Pools)).Returns(() => selectedPool); mockEncounterGenerator.Setup(g => g.Generate(EnvironmentConstants.Dungeon, 9266, "temperature", EnvironmentConstants.TimesOfDay.Night)).Returns(encounter); mockTreasureGenerator.Setup(g => g.GenerateAtLevel(9266)).Returns(treasure); }
private void Awake() { instance = this; }
static TestPoolGenerator() { PoolGenerator g1 = new PoolGenerator("Main"); PoolGenerator g2 = new PoolGenerator("Addition"); PoolGenerator g3 = new PoolGenerator("Reserv"); }