Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
AreaTypeFarm Class Reference
Inheritance diagram for AreaTypeFarm:
AreaType EClass

Public Member Functions

override AIAct GetAI ()
 
Point GetPlowPos ()
 
- Public Member Functions inherited from AreaType
virtual AIAct GetAI ()
 
virtual int GetEfficiency ()
 

Public Attributes

int refSeed
 
- Public Attributes inherited from AreaType
HashSet< int > uidCharas = new HashSet<int>()
 
string id = "Public"
 
BaseArea owner
 
SourceArea.Row _source
 

Properties

override bool IsWork [get]
 
- Properties inherited from AreaType
virtual bool CanAssign [get]
 
virtual bool IsWork [get]
 
virtual bool IsPublicArea [get]
 
virtual bool IsPrison [get]
 
virtual string RandomNameGroup [get]
 
string langHeader [get]
 
SourceArea.Row source [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 4 of file AreaTypeFarm.cs.

Member Function Documentation

◆ GetAI()

override AIAct AreaTypeFarm.GetAI ( )
inlinevirtual

Reimplemented from AreaType.

Definition at line 11 of file AreaTypeFarm.cs.

12 {
13 Point plowPos = GetPlowPos();
14 if (plowPos != null)
15 {
16 if (plowPos.HasObj)
17 {
18 return new TaskCut
19 {
20 pos = plowPos.Copy()
21 };
22 }
23 return new AI_Farm
24 {
25 pos = plowPos.Copy()
26 };
27 }
28 if (EClass.rnd(3) == 0)
29 {
30 return new AI_Farm
31 {
33 };
34 }
35 if (EClass.rnd(3) == 0)
36 {
37 return new AI_Water
38 {
40 };
41 }
42 return base.GetAI();
43 }
Point GetPlowPos()
Definition: AreaTypeFarm.cs:45
BaseArea owner
Definition: AreaType.cs:12
Point GetRandomFreePos()
Definition: BaseArea.cs:60
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
Definition: Point.cs:9
Point Copy()
Definition: Point.cs:467
bool HasObj
Definition: Point.cs:137

References Point.Copy(), GetPlowPos(), BaseArea.GetRandomFreePos(), Point.HasObj, AreaType.owner, and EClass.rnd().

◆ GetPlowPos()

Point AreaTypeFarm.GetPlowPos ( )
inline

Definition at line 45 of file AreaTypeFarm.cs.

46 {
47 List<Point> list = new List<Point>();
48 foreach (Point point in owner.points)
49 {
50 if ((point.sourceFloor.ContainsTag("grass") || point.sourceFloor.tag.Contains("soil")) && (!point.IsFarmField || point.HasObj))
51 {
52 list.Add(point);
53 }
54 }
55 if (list.Count > 0)
56 {
57 return list.RandomItem();
58 }
59 return null;
60 }
PointList points
Definition: BaseArea.cs:26
bool IsFarmField
Definition: Point.cs:127
SourceFloor.Row sourceFloor
Definition: Point.cs:65

References Point.HasObj, Point.IsFarmField, AreaType.owner, BaseArea.points, and Point.sourceFloor.

Referenced by GetAI().

Member Data Documentation

◆ refSeed

int AreaTypeFarm.refSeed

Definition at line 7 of file AreaTypeFarm.cs.

Property Documentation

◆ IsWork

override bool AreaTypeFarm.IsWork
get

Definition at line 9 of file AreaTypeFarm.cs.


The documentation for this class was generated from the following file: