Difference between revisions of "Andromeda Standard Library"

From HIVE
Jump to navigation Jump to search
m (fixed links to GalaxyScript, created See Also section)
(anh em Ta voi nhau coi nha)
Line 1: Line 1:
The '''Andromeda Standard Library''', also known as '''astdlib''', is the official standard library for [[Andromeda]] programming. It provides a standard API for Andromeda programmers to carry out a variety of common tasks, including the use of collections, enrichments and wrapper classes for [[GalaxyScript|Galaxy]] native types, and native functions in a style consistent with Andromeda programming. The library is written entirely in Andromeda.
+
tAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAY
 
 
==Content==
 
The library can be separated into three major branches, each with its own overarching theme:
 
*Utility and collection classes provide standardized implementations for commonly-used objects and algorithms.
 
*Native [[GalaxyScript|Galaxy]] enhancements provide enrichments and wrapper classes to provide an interface between the native Galaxy API and Andromeda design paradigms.
 
*The (2D) Physics engine provides a standardized physics implementation.
 
 
 
===Utility and Collection Classes===
 
[[File:collections hierarchy.png|thumb|alt=Andromeda Standard Library collections class hierarchy|A diagram of the class hierarchy of the collections classes in the Andromeda Standard Library. The map classes are not shown in this diagram. Light blue backgrounds represent abstract classes.]]
 
 
 
All utility and collection classes can be found in the directory <tt>a.util</tt>. Included are standard implementations of commonly-used classes and algorithms. The <tt>Math</tt> static class provides methods for carrying out basic mathematical operations, such as min/max, Euclidian modulo, and absolute value, to name a few. <tt>Key</tt>, <tt>Keyboard</tt>, and <tt>KeyboardModifierState</tt> offer an implementation for dealing with keyboard events.
 
 
 
A large portion of <tt>a.util</tt> is dedicated to providing standard collections implementations. Among the different collection types included are ordered and unordered sets, (dynamically-allocated and growable) arrays, linked lists, queues, and maps. All astdlib collections are implemented as generic types. This enables them to be used with any class type in [[Andromeda]] as well as any native [[GalaxyScript|Galaxy]] type that can be cast to and from (without loss of information) the <tt>int</tt> type.
 
 
 
{{-}}
 
 
 
===Native [[GalaxyScript|Galaxy]] Enhancements===
 
Found in <tt>a.natives</tt> and <tt>a.wrapper</tt>, this branch of astdlib provides a set of enrichments and wrapper classes that interface [[GalaxyScript|Galaxy]] API with [[Andromeda]]'s design paradigms. Whereas Galaxy is a predominantly procedural language similar to C, Andromeda is an object-oriented language more akin to Java. Consequently, the use of the native Galaxy API, including functions and global variables, in Andromeda code is not appropriate and discouraged. The enhancements in astdlib provide a way for Andromeda programmers to use the pre-existing Galaxy API in a manner consistent with Andromeda's design paradigms and style guidelines.
 
 
 
The standard library achieves the [[GalaxyScript|Galaxy]] to [[Andromeda]] interface in two ways, through the use of enrichments and wrapper classes. Enrichments are an Andromeda construct designed to provide pseudo-OOP capabilities for native Galaxy types. They allow instances of these native types to be treated, in a limited fashion, as objects by letting the programmer define instance and static methods for native types. The enrichments found in <tt>a.natives</tt> take advantage of this feature by wrapping native Galaxy functions with instance methods in enrichments for the appropriate types. For example, using <tt>a.natives.unit</tt>, removing a unit from the game can be done with a call to <tt>u.remove()</tt> instead of <tt>UnitRemove(u)</tt>.
 
 
 
Wrapper classes for the most basic native [[GalaxyScript|Galaxy]] types are included in <tt>a.wrapper</tt>. These constructs are real Andromeda classes - not enrichments - and can be used as such. They should only be used in situations where enrichments cannot offer the same functionality since they do incur an overhead cost that is greater than that of enrichments.
 
 
 
===2D Physics Engine===
 
 
 
==See Also==
 
*[[Andromeda]]
 
 
 
==Links==
 
*[http://code.google.com/p/astdlib/source/checkout Source Code]
 
*[http://sc2mod.com/board/index.php?page=Board&boardID=45 Talk]
 
 
 
[[Category:Andromeda]]
 
[[Category:GalaxyScript]]
 

Revision as of 16:46, 2 June 2012

tAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAYtAO TEST MOI DO NHE TUI BAY