Difference between revisions of "Andromeda Standard Library"

From HIVE
Jump to navigation Jump to search
(anh chau Ta voi nhau nhin nap)
m (Reverted edits by 91.121.27.33 (talk) to last revision by DevliN)
 
Line 1: Line 1:
Hello my friend heres my new gig easy as it looks Ill send u a total of 5350++ backlinks to your website in 2 tiers. This gig its for 1 website and up to 5 keywords. First tier to your main website 350 page rank 1-5 and the the second tier of 5000 profile backlinks pointing to your first tier.Ill send u a report in a txt file in less than 48 hours.Any question just send me a private message
+
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.
 +
 
 +
==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]]

Latest revision as of 05:25, 6 August 2012

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 Galaxy native types, and native functions in a style consistent with Andromeda programming. The library is written entirely in Andromeda.

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 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

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 a.util. Included are standard implementations of commonly-used classes and algorithms. The Math static class provides methods for carrying out basic mathematical operations, such as min/max, Euclidian modulo, and absolute value, to name a few. Key, Keyboard, and KeyboardModifierState offer an implementation for dealing with keyboard events.

A large portion of a.util 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 Galaxy type that can be cast to and from (without loss of information) the int type.



Native Galaxy Enhancements

Found in a.natives and a.wrapper, this branch of astdlib provides a set of enrichments and wrapper classes that interface 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 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 a.natives take advantage of this feature by wrapping native Galaxy functions with instance methods in enrichments for the appropriate types. For example, using a.natives.unit, removing a unit from the game can be done with a call to u.remove() instead of UnitRemove(u).

Wrapper classes for the most basic native Galaxy types are included in a.wrapper. 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

Links