public PuzzleOutput areaGeneratePuzzle(BuildingBlock buildingBlockToBind) { if (_verbose) Debug.Log("spawning Area: " + _name); if (_boundBuildingBlock != null) { if (_verbose) Debug.Log("Area already bound to another building block!"); return new PuzzleOutput(); } else { BuildingBlock.shuffle(_inputs); foreach (IAreaConnector input in _inputs) { PuzzleOutput possibleInput = input.areaGeneratePuzzle(this); if (possibleInput == null) continue; _input = input; _boundBuildingBlock = buildingBlockToBind; PuzzleOutput result = new PuzzleOutput(); result.Items.AddRange(possibleInput.Items); result.Relationships.AddRange(possibleInput.Relationships); // Add an area connection relationship here AreaConnectionRelationship connectionRelationship = input.makeConnection(this); result.Relationships.Add(connectionRelationship); return result; } return null; } }
public Area(string name, IAreaConnector input) : base(new List<BuildingBlock>()) { _name = name; _boundBuildingBlock = null; _inputs = new List<IAreaConnector>() {input}; }
public Area(string name, IAreaConnector input) : base(new List <BuildingBlock>()) { _name = name; _boundBuildingBlock = null; _inputs = new List <IAreaConnector>() { input }; }
public PuzzleOutput areaGeneratePuzzle(BuildingBlock buildingBlockToBind) { if (_verbose) { Debug.Log("spawning Area: " + _name); } if (_boundBuildingBlock != null) { if (_verbose) { Debug.Log("Area already bound to another building block!"); } return(new PuzzleOutput()); } else { BuildingBlock.shuffle(_inputs); foreach (IAreaConnector input in _inputs) { PuzzleOutput possibleInput = input.areaGeneratePuzzle(this); if (possibleInput == null) { continue; } _input = input; _boundBuildingBlock = buildingBlockToBind; PuzzleOutput result = new PuzzleOutput(); result.Items.AddRange(possibleInput.Items); result.Relationships.AddRange(possibleInput.Relationships); // Add an area connection relationship here AreaConnectionRelationship connectionRelationship = input.makeConnection(this); result.Relationships.Add(connectionRelationship); return(result); } return(null); } }
public AreaConnectionRelationship makeConnection(IAreaConnector otherArea) { return new AreaConnectionRelationship(_name, otherArea.Name()); }
public AreaConnectionRelationship makeConnection(IAreaConnector otherArea) { return(new AreaConnectionRelationship(_name, otherArea.Name())); }
public puzzlegen.relationship.AreaConnectionRelationship makeConnection(IAreaConnector otherArea) { return(new StartAreaRelationship(otherArea.Name())); }
public AreaConnectionRelationship makeConnection(IAreaConnector otherArea) { return(new AreaConnectionRelationship(_connectingArea.name, otherArea.Name(), true, _keyName, _keyInput.outputSpawnIndex())); }
public AreaConnectionRelationship makeConnection(IAreaConnector otherArea) { return new AreaConnectionRelationship(_connectingArea.name, otherArea.Name(), true, _keyName, _keyInput.outputSpawnIndex()); }