public override int Construct(Point3D location, Map map, ref MapOperationSeries mapOperationSeries) { int trunkHue = base.Construct(location, map, ref mapOperationSeries); GraphicAsset[] leafSet = null; if (LeafSets != null && LeafSets.Count > 0) { //leafSet = LeafSets[Utility.Random(LeafSets.Count)]; leafSet = LeafSets[0]; } if (leafSet != null) { foreach (GraphicAsset asset in leafSet) { //come back and add a usestatic boolean to this class and add it into the constructor too AddStatic addStatic = new AddStatic(map.MapID, asset.ItemID, location.Z, location.X + asset.XOffset, location.Y + asset.YOffset, LEAF_HUE); if (mapOperationSeries == null) { mapOperationSeries = new MapOperationSeries(addStatic, map.MapID); } else { mapOperationSeries.Add(addStatic); } } } return(trunkHue); }
/* * Return value is the HUE */ public virtual int Construct(Point3D location, Map map, ref MapOperationSeries mapOperationSeries) { onBeforeConstruct(location, map, ref mapOperationSeries); GraphicAsset[] trunkSet = null; if (BaseAssetSets != null && BaseAssetSets.Count > 0) { trunkSet = BaseAssetSets[Utility.Random(BaseAssetSets.Count)]; } int hue = 0; List <int> possibleHues = new List <int>(PhaseResources.Keys); if (ConstructUsingHues && possibleHues.Count > 0) { hue = possibleHues[Utility.Random(possibleHues.Count)]; } if (trunkSet != null) { foreach (GraphicAsset asset in trunkSet) { //come back and add a usestatic boolean to this class and add it into the constructor too AddStatic addStatic = new AddStatic(map.MapID, asset.ItemID, location.Z, location.X + asset.XOffset, location.Y + asset.YOffset, hue); if (mapOperationSeries == null) { mapOperationSeries = new MapOperationSeries(addStatic, map.MapID); } else { mapOperationSeries.Add(addStatic); } } } return(hue); }