public void AccessVertices() { FixedList<Vector3> vertices = new FixedList<Vector3>(CreateVertices()); ColoredPolygon cpol = new ColoredPolygon(Color.AntiqueWhite, vertices); FixedList<Vector3> verts2 = new FixedList<Vector3>(CreateVertices()); Assert.AreEqual(verts2, cpol.Vertices); }
public void Sublist() { FixedList<int> list = new FixedList<int>(1, 2, 3, 4, 5); FixedList<int> sub = list.Sublist(2, 2); FixedList<int> expected = new FixedList<int>(3, 4); Assert.AreEqual(expected, sub); }
public void AccessPolygons() { FixedList<ColoredPolygon> pols = new FixedList<ColoredPolygon>( new ColoredPolygon(Color.Black, new Vector3(0, 0, 0))); ColoredPolygonMesh mesh = new ColoredPolygonMesh(pols); Assert.AreEqual(mesh.Polygons, pols); }
public void ChangingInputDoesNotChangeList() { List<int> input = new List<int>(); input.AddRange(new int[] { 1, 2, 3 }); FixedList<int> list = new FixedList<int>(input); input[1] = 0; Assert.AreEqual(2, list[1]); }
public FixedList<Unit> ContentsUnits() { if (_contentUnitsList == null) { var list = base.ExtendedDataField.GetList<Unit>("ContentUnits"); list.Sort((x, y) => x.Name.CompareTo(y.Name)); _contentUnitsList = list.ToFixedList(); } return _contentUnitsList; }
private static ColoredPolygonMesh CreateMesh(int numvertices, int numpolygons, string rest) { FixedList<string> rows = new FixedList<string>(Q.Lines(rest)); FixedList<string> vertexData = rows.Sublist(1, numvertices); FixedList<string> polyData = rows.Sublist(numvertices + 1, numpolygons); FixedList<Vector3> vertices = ParseVertices(vertexData); FixedList<ColoredPolygon> polys = ParsePolygons(polyData, vertices); return new ColoredPolygonMesh(polys); }
public ConstructorDeclaration( Name fullName, DataType type, FixedList <Parameter> parameters, DataType returnType, ControlFlowGraph controlFlow) : base(true, fullName, type, SymbolSet.Empty) { ReturnType = returnType; ControlFlow = controlFlow; Parameters = parameters; }
public void LoadMultipleAssets <T>( AssetEntryRecord assetEntryRecord, FixedList <AssetBundleRecord> necessaryAssetBundleRecords, Action <T[]> onLoaded) where T : UnityEngine.Object { AddLodingTask( assetEntryRecord, necessaryAssetBundleRecords, onLoaded, LinkerFuncs.Multiple <T> .GetAssetBundleRequestFunc, LinkerFuncs.Multiple <T> .GetAssetFunc); }
static internal FixedList <Activity> GetAllUpcomingActivities(Project project) { FixedList <Activity> upcoming = project.GetItems() .FindAll(x => x is Activity && x.IsUpcoming && !((Activity)x).Responsible.EMail.Contains("talanza")) .ConvertAll(x => (Activity)x) .ToFixedList(); upcoming.Sort((x, y) => x.Deadline.CompareTo(y.Deadline)); return(upcoming); }
static internal FixedList <Activity> GetUserUpcomingActivities(Project project, Person user) { FixedList <Activity> upcoming = project.GetItems() .FindAll(x => x is Activity && x.IsUpcoming && ((Activity)x).Responsible.Equals(user)) .ConvertAll(x => (Activity)x) .ToFixedList(); upcoming.Sort((x, y) => x.Deadline.CompareTo(y.Deadline)); return(upcoming); }
static private string ParseActivitiesTable(string body, FixedList <Activity> activities, string tableRowTemplate) { string tableRows = String.Empty; foreach (var item in activities) { tableRows += ParseActivityTemplate(tableRowTemplate, item); } return(body.Replace("{{ACTIVITIES-TABLE-ROWS}}", tableRows)); }
public MethodInvocationExpression( TextSpan span, DataType dataType, ExpressionSemantics semantics, IExpression context, MethodSymbol referencedSymbol, FixedList <IExpression> arguments) : base(span, dataType, semantics) { Context = context; ReferencedSymbol = referencedSymbol; Arguments = arguments; }
public NewObjectExpressionSyntax( TextSpan span, ITypeNameSyntax typeSyntax, Name?constructorName, TextSpan?constructorNameSpan, FixedList <IArgumentSyntax> arguments) : base(span, ExpressionSemantics.Acquire) { Type = typeSyntax; Arguments = arguments; ConstructorName = constructorName; ConstructorNameSpan = constructorNameSpan; }
protected static FunctionSymbol Func( FunctionSymbol mother, string?name = null, NamespaceOrPackageSymbol?ns = null, FixedList <DataType>? @params = null, DataType? @return = null) { return(new FunctionSymbol( ns ?? mother.ContainingSymbol, Name(name) ?? mother.Name, @params ?? mother.ParameterDataTypes, @return ?? mother.ReturnDataType)); }
public SingleObjectModel GetParticipants(string meetingUID) { try { var meeting = Meeting.Parse(meetingUID); FixedList <Contact> participants = meeting.GetAvailableParticipants(); return(new SingleObjectModel(this.Request, participants.ToShortResponse(), typeof(Meeting).FullName)); } catch (Exception e) { throw base.CreateHttpException(e); } }
static internal EMailContent SendByThemeSummaryEmail(Project project, FixedList <Activity> activities, Person contact) { var body = GetTemplate(ContentTemplateType.ByThemeSummaryBody); var rowTemplate = GetTemplate(ContentTemplateType.ByThemeSummaryTableRow); body = ParseGeneralFields(body, project, contact); body = ParseByThemeSummaryTable(body, activities, rowTemplate); return(new EMailContent($"RegTech Project {project.Name} status", body, true)); }
static internal EMailContent AllPendingActivitiesContent(Project project, FixedList <Activity> activities, Person contact) { var body = GetTemplate(ContentTemplateType.AllPendingActivitiesSummary); var withAssigneeTemplate = GetTemplate(ContentTemplateType.ActivityTableRowWithAssignee); body = ParseGeneralFields(body, project, contact); body = ParseActivitiesTable(body, activities, withAssigneeTemplate); return(new EMailContent($"RegTech Project {project.Name} status", body, true)); }
public FixedList <VoucherDescriptorDto> SearchVouchers(SearchVouchersCommand searchCommand) { Assertion.AssertObject(searchCommand, "searchCommand"); searchCommand.EnsureIsValid(); string filter = searchCommand.MapToFilterString(); string sort = searchCommand.MapToSortString(); FixedList <Voucher> list = Voucher.GetList(filter, sort, searchCommand.PageSize); return(VoucherMapper.MapToVoucherDescriptor(list)); }
internal void RemoveBranch(Activity root) { Assertion.Require(root, "root"); FixedList <ProjectItem> branch = root.GetBranch(); foreach (var item in branch) { this.ItemsList.Remove(item); } this.RefreshPositions(); }
private static FixedList<ColoredPolygon> ParsePolygons(FixedList<string> polyData, FixedList<Vector3> vertices) { List<ColoredPolygon> polys = new List<ColoredPolygon>(); foreach (string row in polyData) { string[] words = Q.Words(row); int numIndices = int.Parse(words[0]); int r = int.Parse(words[1]); int g = int.Parse(words[2]); int b = int.Parse(words[3]); List<Vector3> vertexData = new List<Vector3>(); for (int i = 0; i < numIndices; i++) vertexData.Add(vertices[int.Parse(words[4 + i])]); polys.Add(new ColoredPolygon(Color.FromArgb(r, g, b), vertexData)); } return new FixedList<ColoredPolygon>(polys); }
public void NotEquals() { FixedList<int> l1 = new FixedList<int>(1, 2, 3); FixedList<int> l2 = new FixedList<int>(1, 3, 2); Assert.AreNotEqual(l1, l2); }
private static FixedList<Vector3> ParseVertices(FixedList<string> vertexData) { List<Vector3> vertices = new List<Vector3>(); foreach (string row in vertexData) vertices.Add(ParseVertex(row)); return new FixedList<Vector3>(vertices); }
public void Reset() { items = null; }
long GetPartialContractCount_Raw(POrder o, FixedList fl) { long defaultCount = ProductUtil.Ins().GetDefaultOrderCount(o.Code); switch (fl) { case FixedList.None: return 0; case FixedList.One: { return defaultCount; } case FixedList.Half: { return (o.ReqCount / defaultCount) * defaultCount; } case FixedList.Full: { return o.ReqCount; } default: break; } return 0; }
private ArrayList ToProductTermModel(FixedList<ProductTerm> list) { return new ArrayList(list.Select((x) => ToProductTermModel(x)).ToArray()); }
public void Constr() { FixedList<int> list = new FixedList<int>(); }
public void Count() { FixedList<string> list = new FixedList<string>("hej", "hej"); Assert.AreEqual(2, list.Count); }
/// <summary> /// Initializes the audio controller. /// </summary> public void Initialize(AudioControllerConfig config) { // AudioSource allocation. { int maxCount = Mathf.Max (1, config.AudioSourceMaxCount); _availableSources = new FixedList<AudioSource> (maxCount); _availableSourceInfoIndices = new FixedList<int> (maxCount); _activeSourceInfoIndices = new FixedList<int> (maxCount); _sourceInfos = new FixedList<AudioSourceInfo> (maxCount); for (int i = 0; i < maxCount; i++) { GameObject go = new GameObject ("AudioSource_" + i); Transform xform = go.transform; xform.parent = this.transform; AudioSource audioSource = go.AddComponent<AudioSource> (); ReturnSourceToPool (audioSource); _availableSourceInfoIndices.Add (i); _sourceInfos.Add (new AudioSourceInfo ()); } } _audioLoader = config.AudioLoader; if (_audioLoader == null) { Debug.LogError ("AudioLoader not set!"); } }