File: README.md

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (18 lines) | stat: -rw-r--r-- 890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# API skeletons for FOCS API

This code is not executable, it does nothing in runtime. 

The only purpose of it, is to provide an autocomplete and basic static checking for the FOCS code.

# How it works
FOCS objects are added to globals, so you actually don't need to import it to run parser.

- Named imports (from x import y) : When we import from one of python modules, the name is looked in the globals() and returned.
- Asterisk import (from x import *) works in the same way, just adding all names to the namespace.

# Game limitation
FOCS objects are added to the builtins during only when file with it parsed. In that case we have to use asterisk imports.
For example `from focs._species import *` because Species is not defined when the module is executed.

# Developing
We don't want to add all things at once, so we will add them in timely manner during the conversion process.