コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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]);
 }
コード例 #5
0
 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;
 }
コード例 #6
0
ファイル: CplLoader.cs プロジェクト: Felixdev/dogfight2008
        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);
        }
コード例 #7
0
 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;
 }
コード例 #8
0
 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);
 }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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;
 }
コード例 #13
0
 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;
 }
コード例 #14
0
 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));
 }
コード例 #15
0
        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);
            }
        }
コード例 #16
0
        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));
        }
コード例 #17
0
        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));
        }
コード例 #18
0
        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));
        }
コード例 #19
0
        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();
        }
コード例 #20
0
ファイル: CplLoader.cs プロジェクト: Felixdev/dogfight2008
 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);
 }
コード例 #21
0
 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);
 }
コード例 #22
0
ファイル: CplLoader.cs プロジェクト: Felixdev/dogfight2008
 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);
 }
コード例 #23
0
 public void Reset() {
   items = null;
 }
コード例 #24
0
 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;
 }
コード例 #25
0
 private ArrayList ToProductTermModel(FixedList<ProductTerm> list) {
   return new ArrayList(list.Select((x) => ToProductTermModel(x)).ToArray());
 }
コード例 #26
0
 public void Constr()
 {
     FixedList<int> list = new FixedList<int>();
 }
コード例 #27
0
 public void Count()
 {
     FixedList<string> list = new FixedList<string>("hej", "hej");
       Assert.AreEqual(2, list.Count);
 }
コード例 #28
0
ファイル: AudioController.cs プロジェクト: spotco/ld-33
        /// <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!");
            }
        }