Skip to content

Commit b4701ed

Browse files
committed
AS3 Intrinsic Library Improvement
Updated to add intrinsic library paths backwards from the current fp version. Added Library\AS3\intrinsic\FP19\Vector.as file.
1 parent ec698d9 commit b4701ed

File tree

2 files changed

+92
-10
lines changed
  • External/Plugins/AS3Context
  • FlashDevelop/Bin/Debug/Library/AS3/intrinsic/FP19

2 files changed

+92
-10
lines changed

External/Plugins/AS3Context/Context.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -334,20 +334,19 @@ public override void BuildClassPath()
334334
}
335335

336336
// intrinsics (deprecated, excepted for FP10 Vector.<T>)
337-
string fp9cp = as3settings.AS3ClassPath + S + "FP9";
338-
AddPath(PathHelper.ResolvePath(fp9cp));
339-
if (majorVersion > 9)
337+
// add from the highest version number (FP11 > FP10 > FP9)
338+
if (majorVersion >= 9)
340339
{
341-
for (int i = 10; i <= majorVersion; i++)
340+
string fp = as3settings.AS3ClassPath + S + "FP";
341+
for (int i = majorVersion; i >= 10; i--)
342342
{
343-
string fp10cp = as3settings.AS3ClassPath + S + "FP" + i;
344-
AddPath(PathHelper.ResolvePath(fp10cp));
345-
for (int j = 1; j <= minorVersion; j++)
343+
for (int j = minorVersion; j >= 0; j--)
346344
{
347-
string fp101cp = as3settings.AS3ClassPath + S + "FP" + majorVersion + "." + minorVersion;
348-
AddPath(PathHelper.ResolvePath(fp101cp));
345+
AddPath(PathHelper.ResolvePath(fp + i + "." + j));
349346
}
350-
}
347+
AddPath(PathHelper.ResolvePath(fp + i));
348+
}
349+
AddPath(PathHelper.ResolvePath(fp + "9"));
351350
}
352351

353352
// add external pathes
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package
2+
{
3+
/// The Vector class lets you access and manipulate a vector - an array whose elements all have the same data type.
4+
public class Vector.<T>
5+
{
6+
/// [FP10] The range of valid indices available in the Vector.
7+
public function get length () : int;
8+
public function set length (value:int) : void;
9+
10+
/// [FP10] Indicates whether the length property of the Vector can be changed.
11+
public function get fixed () : Boolean;
12+
public function set fixed (value:int) void;
13+
14+
/// [FP10] Creates a Vector with the specified base type.
15+
public function Vector (length:uint = 0, fixed:Boolean = false);
16+
17+
/// [FP10] Concatenates the elements specified in the parameters.
18+
public function concat (...args) : Vector.<T>;
19+
20+
/// [FP10] Executes a test function on each item in the Vector until an item is reached that returns false for the specified function.
21+
public function every (callback:Function, thisObject:Object = null) : Boolean;
22+
23+
/// [FP10] Executes a test function on each item in the Vector and returns a new Vector containing all items that return true for the specified function.
24+
public function filter (callback:Function, thisObject:Object = null) : Vector.<T>;
25+
26+
/// [FP10] Executes a function on each item in the Vector.
27+
public function forEach (callback:Function, thisObject:Object = null) : void;
28+
29+
/// [FP10] Searches for an item in the Vector and returns the index position of the item.
30+
public function indexOf (searchElement:T, fromIndex:int = 0) : int;
31+
32+
/// [FP19] Insert a single element into the Vector.
33+
public function insertAt (index:int, element:T) : void;
34+
35+
/// [FP10] Converts the elements in the Vector to strings.
36+
public function join (sep:String = ",") : String;
37+
38+
/// [FP10] Searches for an item in the Vector, working backward from the specified index position, and returns the index position of the matching item.
39+
public function lastIndexOf (searchElement:T, fromIndex:int = 0x7fffffff) : int;
40+
41+
/// [FP10] Executes a function on each item in the Vector, and returns a new Vector of items corresponding to the results of calling the function on each item in this Vector.
42+
public function map (callback:Function, thisObject:Object = null) : Vector.<T>;
43+
44+
/// [FP10] Removes the last element from the Vector and returns that element.
45+
public function pop () : T;
46+
47+
/// [FP10] Adds one or more elements to the end of the Vector and returns the new length of the Vector.
48+
public function push (...args) : uint;
49+
50+
/// [FP19] Remove a single element from the Vector.
51+
public function removeAt (index:int) : T;
52+
53+
/// [FP10] Reverses the order of the elements in the Vector.
54+
public function reverse () : Vector.<T>;
55+
56+
/// [FP10] Removes the first element from the Vector and returns that element.
57+
public function shift () : T;
58+
59+
/// [FP10] Returns a new Vector that consists of a range of elements from the original Vector.
60+
public function slice (startIndex:int = 0, endIndex:int = 16777215) : Vector.<T>;
61+
62+
/// [FP10] Executes a test function on each item in the Vector until an item is reached that returns true.
63+
public function some (callback:Function, thisObject:Object = null) : Boolean;
64+
65+
/// [FP10] Sorts the elements in the Vector.
66+
public function sort (compareFunction:Function) : Vector.<T>;
67+
68+
/// [FP10] Adds elements to and removes elements from the Vector.
69+
public function splice (startIndex:int, deleteCount:uint, ...items) : Vector.<T>;
70+
71+
/// [FP10] Returns a string that represents the elements in the Vector.
72+
public function toString () : String;
73+
74+
/// [FP10] Returns a string that represents the elements in the specified Vector.
75+
public function toLocaleString () : String;
76+
77+
/// [FP10] Adds one or more elements to the beginning of the Vector and returns the new length of the Vector.
78+
public function unshift (...args) : uint;
79+
80+
}
81+
82+
}
83+

0 commit comments

Comments
 (0)