-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathteam.go
931 lines (737 loc) · 20.7 KB
/
team.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
package rcss
import (
"fmt"
"strconv"
)
type Side rune
const (
LeftSide Side = 'l'
RightSide Side = 'r'
)
type UniformNumber uint8
type PlayMode string
const (
Null PlayMode = "null"
BeforeKickOff PlayMode = "before_kick_off"
TimeOver PlayMode = "time_over"
PlayOn PlayMode = "play_on"
KickOffLeft PlayMode = "kick_off_l"
KickOffRight PlayMode = "kick_off_r"
KickInLeft PlayMode = "kick_in_left"
KickInRight PlayMode = "kick_in_right"
FreeKickLeft PlayMode = "free_kick_left"
FreeKickRight PlayMode = "free_kick_right"
CornerKickLeft PlayMode = "corner_kick_left"
CornerKickRight PlayMode = "corner_kick_right"
GoalKickLeft PlayMode = "goal_kick_left"
GoalKickRight PlayMode = "goal_kick_right"
AfterGoalLeft PlayMode = "after_goal_left"
AfterGoalRight PlayMode = "after_goal_right"
DropBall PlayMode = "drop_ball"
OffSideLeft PlayMode = "off_side_left"
OffSideRight PlayMode = "off_side_right"
PkLeft PlayMode = "pk_left"
PkRight PlayMode = "pk_right"
FirstHalfOver PlayMode = "first_half_over"
Pause PlayMode = "pause"
Human PlayMode = "human"
FoulChargeLeft PlayMode = "foul_charge_left"
FoulChargeRight PlayMode = "foul_charge_right"
FoulPushLeft PlayMode = "foul_push_left"
FoulPushRight PlayMode = "foul_push_right"
FoulMultipleAttackerLeft PlayMode = "foul_multiple_attacker_left"
FoulMultipleAttackerRight PlayMode = "foul_multiple_attacker_right"
FoulBallOutLeft PlayMode = "foul_ball_out_left"
FoulBallOutRight PlayMode = "foul_ball_out_right"
Max PlayMode = "max"
)
const (
InitSideIndex = 0
InitUniformNumberindex = 1
InitPlayMode = 2
)
type Init struct {
Init struct {
Array []string `sexp:"init,siblings"`
}
Side Side
UniformNumber UniformNumber
PlayMode PlayMode
}
//Set Values Of init Command
func (init *Init) SetValues() {
init.Side = Side((init.Init.Array[InitSideIndex])[0])
x, _ := strconv.ParseUint(init.Init.Array[InitUniformNumberindex], 10, 8)
init.UniformNumber = UniformNumber(x)
init.PlayMode = PlayMode(init.Init.Array[InitPlayMode])
}
// Aggregate of 109 Server Parameters
type ServerParameters struct {
// ServerParameters struct {
// Array [109]string `sexp:"server_param,siblings"`
// }
// Goal width
// name: goal_width
GoalWidth float32 `sexp:"goal_width"`
// Player size
// name: player_size
PlayerSize float32 `sexp:"player_size"`
// Player decay
// name: player_decay
PlayerDecay float32 `sexp:"player_decay"`
//
// name: player_rand
PlayerRand float32 `sexp:"player_rand"`
// Player weight
// name: player_weight
PlayerWeight float32 `sexp:"player_weight"`
// Maximum player velocity
// name: player_speed_max
MaxPlayerSpeed float32 `sexp:"player_speed_max"`
// Maximum player acceleration
// name: player_accel_max
MaxPlayerAcceleration float32 `sexp:"player_accel_max"`
// Maximum player stamina
// name: stamina_max
MaxStamina float32 `sexp:"stamina_max"`
// Maximum player stamina increment
// name: stamina_inc_max
MaxStaminaIncrement float32 `sexp:"stamina_inc_max"`
// Player recovery decrement threshold
// name: recover_dec_thr
PlayerRecoveryDecrementThreshold float32 `sexp:"recover_dec_thr"`
// Minimum player recovery
// name: recover_min
MinPlayerRecovery float32 `sexp:"recover_min"`
// Player recovery decrement
// name: recover_dec
PlayerRecoveryDecrement float32 `sexp:"recover_dec"`
// Player dash effort decrement threshold
// name: effort_dec_thr
EffortDecrementThreshold float32 `sexp:"effort_dec_thr"`
// Minimum player dash effort
// name: effort_min
MinEffort float32 `sexp:"effort_min"`
// Player dash effort decrement
// name: effort_dec
EffortDecrement float32 `sexp:"effort_dec"`
// Dash effort increment threshold
// name: effort_inc_thr
EffortIncrementThreshold float32 `sexp:"effort_inc_thr"`
// Dash effort increment
// name: effort_inc
EffortIncrement float32 `sexp:"effort_inc"`
// Noise added directly to kicks
// name: kick_rand
KickRand float32 `sexp:"kick_rand"`
// Flag whether to use team specific actuator noise
// name: team_actuator_noise
TeamActuatorNoise int `sexp:"team_actuator_noise"`
// Factor to multiply prand for left team
// name: prand_factor_l
LeftPlayerRandFactor float32 `sexp:"prand_factor_l"`
// Factor to multiply prand for right team
// name: prand_factor_r
RightPlayerRandFactor float32 `sexp:"prand_factor_r"`
// Factor to multiply kick rand for left team
// name: kick_rand_factor_l
LeftKickRandFactor float32 `sexp:"kick_rand_factor_l"`
// Factor to multiply kick rand for right team
// name: kick_rand_factor_r
RightKickRandFactor float32 `sexp:"kick_rand_factor_r"`
// Ball size
// name: ball_size
BallSize float32 `sexp:"ball_size"`
// Ball decay
// name: ball_decay
BallDecay float32 `sexp:"ball_decay"`
//
// name: ball_rand
BallRand float32 `sexp:"ball_rand"`
// Weight of the ball
// name: ball_weight
BallWeight float32 `sexp:"ball_weight"`
// Maximum ball velocity
// name: ball_speed_max
MaxBallSpeed float32 `sexp:"ball_speed_max"`
// Maximum ball acceleration
// name: ball_accel_max
MaxBallAcceleration float32 `sexp:"ball_accel_max"`
// Dash power rate
// name: dash_power_rate
DashPowerRate float32 `sexp:"dash_power_rate"`
//
// name: kick_power_rate
KickPowerRate float32 `sexp:"kick_power_rate"`
// Kickable margin
// name: kickable_margin
KickableMargin float32 `sexp:"kickable_margin"`
// Control radius
// name: control_radius
ControlRadius float32 `sexp:"control_radius"`
// Goalie catch probability
// name: catch_probability
GoalieCatchProbability float32 `sexp:"catch_probability"`
// Goalie catchable area length
// name: catchable_area_l
GoalieCatchableAreaLength float32 `sexp:"catchable_area_l"`
// Goalie catchable area width
// name: catchable_area_w
GoalieCatchableAreaWidth float32 `sexp:"catchable_area_w"`
// Goalie maximum moves after a catch
// name: goalie_max_moves
MaxGoalieAfterCatchMoves int `sexp:"goalie_max_moves"`
// Maximum power
// name: maxpower
MaxPower int `sexp:"maxpower"`
// Minumum power
// name: minpower
MinPower int `sexp:"minpower"`
// Maximum moment
// name: maxmoment
MaxMoment int `sexp:"maxmoment"`
// Minimum moment
// name: minmoment
MinMoment int `sexp:"minmoment"`
// Maximum neck moment
// name: maxneckmoment
MaxNeckMoment int `sexp:"maxneckmoment"`
// Minimum neck moment
// name: minneckmoment
MinNeckMoment int `sexp:"minneckmoment"`
// Maximum neck angle
// name: maxneckang
MaxNeckAngle int `sexp:"maxneckang"`
// Minimum neck angle
// name: minneckang
MinNeckAngle int `sexp:"minneckang"`
// Visible angle
// name: visible_angle
VisibleAngle float32 `sexp:"visible_angle"`
// Visible distance
// name: visible_distance
VisibleDistance float32 `sexp:"visible_distance"`
// Audio cut off distance
// name: audio_cut_dist
AudioCutOffDistance float32 `sexp:"audio_cut_dist"`
// Quantize step of distance for movable objects
// name: quantize_step
MovableObjectsDistanceQuantizeStep float32 `sexp:"quantize_step"`
// Quantize step of distance for landmarks
// name: quantize_step_l
LandmarksDistanceQuantizeStep float32 `sexp:"quantize_step_l"`
// Quantize step of direction
// name: quantize_step_dir
DirectionQuantizeStep float32 `sexp:"quantize_step_dir"`
// Quantize step of distance for movable objects for left team
// name: quantize_step_dist_team_l
LeftTeamMovableObjectsDistanceQuantizeStep float32 `sexp:"quantize_step_dist_team_l"`
// Quantize step of distance for movable objects for right team
// name: quantize_step_dist_team_r
RightTeamMovableObjectsDistanceQuantizeStep float32 `sexp:"quantize_step_dist_team_r"`
// Quantize step of distance for landmarks for left team
// name: quantize_step_dist_l_team_l
LeftTeamLandmarksDistanceQuantizeStep float32 `sexp:"quantize_step_dist_l_team_l"`
// Quantize step of distance for landmarks for right team
// name: quantize_step_dist_l_team_r
RightTeamLandmarksDistanceQuantizeStep float32 `sexp:"quantize_step_dist_l_team_r"`
// Quantize step of direction for left team
// name: quantize_step_dir_team_l
LeftTeamDirectionQuantizeStep float32 `sexp:"quantize_step_dir_team_l"`
// Quantize step of direction for right team
// name: quantize_step_dir_team_r
RightTeamDirectionQuantizeStep float32 `sexp:"quantize_step_dir_team_r"`
// Corner Kick Margin
// name: ckick_margin
CornerKickMargin float32 `sexp:"ckick_margin"`
// Wind direction
// name: wind_dir
WindDirection float32 `sexp:"wind_dir"`
//
// name: wind_force
WindForce float32 `sexp:"wind_force"`
//
// name: wind_rand
WindRand float32 `sexp:"wind_rand"`
// Wind factor is none
// name: wind_none
NoWind int `sexp:"wind_none"`
// Wind factor is random
// name: wind_random
ProbableWind int `sexp:"wind_random"`
// Inertia moment for turn
// name: inertia_moment
InertiaMoment float32 `sexp:"inertia_moment"`
// Length of a half time in seconds
// name: half_time
// TODO: use time.Duration
HalfTime int `sexp:"half_time"`
// Number of cycles to wait until dropping the ball automatically
// name: drop_ball_time
DropBallTime int `sexp:"drop_ball_time"`
// Player port number
// name: port
Port int `sexp:"port"`
// Offline coach port
// name: coach_port
OfflineCoachPort int `sexp:"coach_port"`
// Online coach port
// name: olcoach_port
OnlineCoachPort int `sexp:"olcoach_port"`
// Upper limit of the number of online coach’s message
// name: say_coach_cnt_max
OnlineCoachMaxMessageNumber int `sexp:"say_coach_cnt_max"`
// Upper limit of length of online coach’s message
// name: say_coach_msg_size
OnlineCoachMaxMessageLength int `sexp:"say_coach_msg_size"`
// Time step of simulation [unit:msec]
// name: simulator_step
SimulatorStep int `sexp:"simulator_step"`
// Time step of visual information [unit:msec]
// name: send_step
SendStep int `sexp:"send_step"`
// Time step of acception of commands [unit: msec]
// name: recv_step
ReceiveStep int `sexp:"recv_step"`
// Time step of body being sensed
// name: sense_body_step
SenseBodyStep int `sexp:"sense_body_step"`
// String size of say message [unit:byte]
// name: say_msg_size
SayMessageSize int `sexp:"say_msg_size"`
// Time window which controls how many messages can be sent (coach language)
// name: clang_win_size
CoachLanguageWindowSize int `sexp:"clang_win_size"`
// Number of messages per window
// name: clang_define_win
CoachLanguageMessagesPerWindow int `sexp:"clang_define_win"`
//
// name: clang_meta_win
CoachLanguageMetaWindow int `sexp:"clang_meta_win"`
//
// name: clang_advice_win
CoachLanguageAdviceWindow int `sexp:"clang_advice_win"`
//
// name: clang_info_win
CoachLanguageInformationWindow int `sexp:"clang_info_win"`
// Delay between receipt of message and send to players
// name: clang_mess_delay
CoachLanguageMessageDelay int `sexp:"clang_mess_delay"`
// Maximum number of coach messages sent per cycle
// name: clang_mess_per_cycle
CoachLanguageMaxMessagesPerCycle int `sexp:"clang_mess_per_cycle"`
//
// name: head_max
MaxHear int `sexp:"head_max"`
//
// name: hear_inc
HearIncrement int `sexp:"hear_inc"`
//
// name: hear_decay
HearDecay int `sexp:"hear_decay"`
//
// name: catch_ban_cycle
CatchBanCycle int `sexp:"catch_ban_cycle"`
// ?
// name: coach
Coach int `sexp:"coach"`
// ?
// name: coach_w_referee
CoachWithReferee int `sexp:"coach_w_referee"`
// ?
// name: old_coach_hear
OldCoachHear int `sexp:"old_coach_hear"`
// Interval of online coach’s look
// name: send_vi_step
OnlineCoachLookInterval int `sexp:"send_vi_step"`
// Flag for using off side rule
// name: use_offside
UseOffside int `sexp:"use_offside"`
// Offside active area size
// name: offside_active_area_size
OffsideActiveAreaSize float64 `sexp:"offside_active_area_size"`
// forbid kick off offside
// name: forbid_kick_off_offside
ForbidKickOffOffside int `sexp:"forbid_kick_off_offside"`
//
// name: log_file
LogFile string `sexp:"log_file"`
//
// name: record
Record int `sexp:"record"`
//
// name: record_version
RecordVersion int `sexp:"record_version"`
// Flag for record log
// name: record_log
RecordLog int `sexp:"record_log"`
// Flag for record client command log
// name: record_messages
RecordMessages int `sexp:"record_messages"`
// Flag for send client command log
// name: send_log
SendLog int `sexp:"send_log"`
// Flag for writing cycle lenth to log file
// name: log_times
LogTimes int `sexp:"log_times"`
// Flag for verbose mode
// name: verbose
Verbose int `sexp:"verbose"`
//
// name: replay
Replay int `sexp:"replay"`
// Offsie kick margin
// name: offside_kick_margin
OffsideKickMargin float32 `sexp:"offside_kick_margin"`
//
// name: slow_down_factor
SlowDownFactor float32 `sexp:"slow_down_factor"`
// ?
// name: start_goal_l
LeftStartGoal string `sexp:"start_goal_l"`
// ?
// name: start_goal_r
RightStartGoal string `sexp:"start_goal_r"`
// ?
// name: fullstate_l
LeftFullState string `sexp:"fullstate_l"`
// ?
// name: fullstate_r
RightFullState string `sexp:"fullstate_r"`
}
// func (s *ServerParameters) SetValues() {
// // x, _ := strconv.ParseFloat(s.ServerParameters.Array[0], 64)
// // s.GoalWidth = float32(x)
// fmt.Println(len(s.ServerParameters.Array))
// }
type PlayerParameters struct {
// PlayerParameters struct {
// Array []string `sexp:"player_param,siblings"`
// }
PlayerTypes float64 `sexp:"player_types"`
SubsMax float64 `sexp:"subs_max"`
PtMax float64 `sexp:"pt_max"`
PlayerSpeedMaxDeltaMin float64 `sexp:"player_speed_max_delta_min"`
PlayerSpeedMaxDeltaMax float64 `sexp:"player_speed_max_delta_max"`
StaminaIncMaxDeltaFactor float64 `sexp:"stamina_inc_max_delta_factor"`
PlayerDecayDeltaMin float64 `sexp:"player_decay_delta_min"`
PlayerDecayDeltaMax float64 `sexp:"player_decay_delta_max"`
InertiaMomentDeltaFactor float64 `sexp:"inertia_moment_delta_factor"`
DashPowerRateDeltaMin float64 `sexp:"dash_power_rate_delta_min"`
DashPowerRateDeltaMax float64 `sexp:"dash_power_rate_delta_max"`
PlayerSizeDeltaFactor float64 `sexp:"player_size_delta_factor"`
KickableMarginDeltaMin float64 `sexp:"kickable_margin_delta_min"`
KickableMarginDeltaMax float64 `sexp:"kickable_margin_delta_max"`
KickRandDeltaFactor float64 `sexp:"kick_rand_delta_factor"`
ExtraStaminaDeltaMin float64 `sexp:"extra_stamina_delta_min"`
ExtraStaminaDeltaMax float64 `sexp:"extra_stamina_delta_max"`
EffortMaxDeltaFactor float64 `sexp:"effort_max_delta_factor"`
EffortMinDeltaFactor float64 `sexp:"effort_min_delta_factor"`
SpareLong1 float64 `sexp:"sparelong1"`
SpareLong2 float64 `sexp:"sparelong2"`
SpareLong3 float64 `sexp:"sparelong3"`
SpareLong4 float64 `sexp:"sparelong4"`
SpareLong5 float64 `sexp:"sparelong5"`
SpareLong6 float64 `sexp:"sparelong6"`
SpareLong7 float64 `sexp:"sparelong7"`
SpareLong8 float64 `sexp:"sparelong8"`
SpareLong9 float64 `sexp:"sparelong9"`
SpareLong10 float64 `sexp:"sparelong10"`
SpareShort1 float64 `sexp:"spareshort1"`
SpareShort2 float64 `sexp:"spareshort2"`
SpareShort3 float64 `sexp:"spareshort3"`
SpareShort4 float64 `sexp:"spareshort4"`
SpareShort5 float64 `sexp:"spareshort5"`
SpareShort6 float64 `sexp:"spareshort6"`
SpareShort7 float64 `sexp:"spareshort7"`
SpareShort8 float64 `sexp:"spareshort8"`
SpareShort9 float64 `sexp:"spareshort9"`
SpareShort10 float64 `sexp:"spareshort10"`
}
type PlayerType struct {
// Player Identifier
Id float64 `sexp:"id"`
// Maximum Player Speed
PlayerSpeedMax float64 `sexp:"player_speed_max"`
// Maximum Stamina Increase
StaminaIncMax float64 `sexp:"stamina_inc_max"`
// Player Decay
PlayerDecay float64 `sexp:"player_decay"`
// Inertia Moment
InertiaMoment float64 `sexp:"inertia_moment"`
// Dash Power Rate
DashPowerRate float64 `sexp:"dash_power_rate"`
// Player Size
PlayerSize float64 `sexp:"player_size"`
// Kickable Margin
KickableMargin float64 `sexp:"kickable_margin"`
// Kick Rand
KickRand float64 `sexp:"kick_rand"`
// Extra Stamina
ExtraStamina float64 `sexp:"extra_stamina"`
// Maximum Effort
EffortMax float64 `sexp:"effort_max"`
// Minimum Effort
EffortMin float64 `sexp:"effort_min"`
SpareLong1 float64 `sexp:"sparelong1"`
SpareLong2 float64 `sexp:"sparelong2"`
SpareLong3 float64 `sexp:"sparelong3"`
SpareLong4 float64 `sexp:"sparelong4"`
SpareLong5 float64 `sexp:"sparelong5"`
SpareLong6 float64 `sexp:"sparelong6"`
SpareLong7 float64 `sexp:"sparelong7"`
SpareLong8 float64 `sexp:"sparelong8"`
SpareLong9 float64 `sexp:"sparelong9"`
SpareLong10 float64 `sexp:"sparelong10"`
}
type Hear struct {
Hear struct {
Array []string `sexp:"hear,siblings"`
}
Time float64
Sender string
Message string
}
func (h *Hear) SetValues() {
x, err := strconv.ParseFloat(h.Hear.Array[0], 64)
if nil != err {
fmt.Println(err)
} else {
h.Time = x
}
h.Sender = h.Hear.Array[1]
h.Message = h.Hear.Array[2]
}
type See struct {
see struct {
Array []string `sexp:"see,siblings"`
}
}
type Flag struct {
flag string
Type string
Left bool
Right bool
Top bool
Bottom bool
Center bool
Goal bool
Penalty bool
Number float64
Dir float64
Dis float64
Time int
}
func (f Flag) Flag() string {
return f.flag
}
func (f Flag) Head() string {
return f.Type
}
func (f Flag) IsLeft() bool {
return f.Left
}
func (f Flag) IsRight() bool {
return f.Right
}
func (f Flag) IsTop() bool {
return f.Top
}
func (f Flag) IsBottom() bool {
return f.Bottom
}
func (f Flag) IsCenter() bool {
return f.Center
}
func (f Flag) IsGoal() bool {
return f.Goal
}
func (f Flag) IsPenalty() bool {
return f.Penalty
}
func (f Flag) Direction() float64 {
return f.Dir
}
func (f Flag) Distance() float64 {
return f.Dis
}
func (f Flag) DistanceChng() float64 {
return 0
}
func (f Flag) DirectionChng() float64 {
return 0
}
func (f Flag) DataArriveTime() int {
return f.Time
}
func (f *Flag) Set() {
f.flag = ""
f.Type = "f"
f.Left = false
f.Right = false
f.Top = false
f.Bottom = false
f.Center = false
f.Goal = false
f.Penalty = false
f.Number = -1
f.Dir = 0
f.Dis = 0
f.Time = -1
}
type Goal struct {
Type string
Left bool
Right bool
Dir float64
Dis float64
Time int
// DisChng float64
// DirChng float64
}
func (g Goal) Head() string {
return g.Type
}
func (g Goal) IsLeft() bool {
return g.Left
}
func (g Goal) IsRight() bool {
return g.Right
}
func (g Goal) Direction() float64 {
return g.Dir
}
func (g Goal) Distance() float64 {
return g.Dis
}
func (g Goal) DistanceChng() float64 {
return 0
}
func (g Goal) DirectionChng() float64 {
return 0
}
func (g Goal) DataArriveTime() int {
return g.Time
}
func (g *Goal) Set() {
g.Type = "g"
g.Left = false
g.Right = false
g.Dis = 0
g.Dir = 0
g.Time = -1
}
type Ball struct {
Type string
Dis float64
Dir float64
DisChng float64
DirChng float64
Time int
}
func (b Ball) Head() string {
return b.Type
}
func (b Ball) Direction() float64 {
return b.Dir
}
func (b Ball) Distance() float64 {
return b.Dis
}
func (b Ball) DirectionChng() float64 {
return b.DirChng
}
func (b Ball) DistanceChng() float64 {
return b.DisChng
}
func (b Ball) DataArriveTime() int {
return b.Time
}
func (b *Ball) Set() {
b.Type = "b"
b.Dis = 0
b.Dir = 0
b.DirChng = 0
b.DisChng = 0
b.Time = -1
}
type Line struct {
Type string
Left bool
Right bool
Top bool
Bottom bool
Dis float64
Dir float64
Time int
}
func (l Line) Head() string {
return l.Type
}
func (l Line) IsLeft() bool {
return l.Left
}
func (l Line) IsRight() bool {
return l.Right
}
func (l Line) IsTop() bool {
return l.Top
}
func (l Line) IsBottom() bool {
return l.Bottom
}
func (l Line) Direction() float64 {
return l.Dir
}
func (l Line) Distance() float64 {
return l.Dis
}
func (l Line) DirectionChng() float64 {
return 0
}
func (l Line) DistanceChng() float64 {
return 0
}
func (l Line) DataArriveTime() int {
return l.Time
}
func (l *Line) Set() {
l.Type = "l"
l.Left = false
l.Right = false
l.Top = false
l.Bottom = false
l.Dis = 0
l.Dir = 0
l.Time = -1
}
// func (g Goal) DirectionChng() float64 {
// return g.DirChng
// }
// func (g Goal) DistanceChng() float64 {
// return g.DisChng
// }
type Object interface {
Head() string
Direction() float64
Distance() float64
DistanceChng() float64
DirectionChng() float64
DataArriveTime() int
}
// Input Driver
type Team interface {
Name() string
Kickoff()
SetSide(side Side)
Invite(m Match, unum UniformNumber)
SetPlayMode(mode PlayMode)
See(Object)
//Init(match Match, mode PlayMode)
ServerParam(sp ServerParameters)
PlayerParam(pp PlayerParameters)
PlayerType(pt PlayerType)
Hear()
SenseBody()
Score()
}